File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -578,12 +578,12 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
578578 pre
579579 case _ =>
580580 tree1
581-
581+
582582 val countsAsPure =
583583 if dropOp(tree1).symbol.isInlineVal
584584 then isIdempotentExpr(tree1)
585585 else isPureExpr(tree1)
586-
586+
587587 if countsAsPure then Literal (value).withSpan(tree.span)
588588 else
589589 val pre = dropOp(tree1)
@@ -879,14 +879,15 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
879879 }
880880 ! tree.symbol.exists && tree.isTerm && hasRefinement(tree.qualifier.tpe)
881881 }
882- def loop (tree : Tree ): Boolean = tree match {
882+ def loop (tree : Tree ): Boolean = tree match
883+ case TypeApply (fun, _) =>
884+ loop(fun)
883885 case Apply (fun, _) =>
884886 loop(fun)
885887 case tree : Select =>
886888 isStructuralTermSelect(tree)
887889 case _ =>
888890 false
889- }
890891 loop(tree)
891892 }
892893
Original file line number Diff line number Diff line change 1+ trait Foo extends reflect.Selectable
2+
3+ val foo = new Foo :
4+ def bar [A ](): Int = ???
5+
6+ val x = foo.bar() // error: Structural access not allowed on method bar because it is polymorphic
7+
8+ val y = foo.bar[Int ]() // error: Structural access not allowed on method bar because it is polymorphic
You can’t perform that action at this time.
0 commit comments