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] =>
578
578
pre
579
579
case _ =>
580
580
tree1
581
-
581
+
582
582
val countsAsPure =
583
583
if dropOp(tree1).symbol.isInlineVal
584
584
then isIdempotentExpr(tree1)
585
585
else isPureExpr(tree1)
586
-
586
+
587
587
if countsAsPure then Literal (value).withSpan(tree.span)
588
588
else
589
589
val pre = dropOp(tree1)
@@ -879,14 +879,15 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
879
879
}
880
880
! tree.symbol.exists && tree.isTerm && hasRefinement(tree.qualifier.tpe)
881
881
}
882
- def loop (tree : Tree ): Boolean = tree match {
882
+ def loop (tree : Tree ): Boolean = tree match
883
+ case TypeApply (fun, _) =>
884
+ loop(fun)
883
885
case Apply (fun, _) =>
884
886
loop(fun)
885
887
case tree : Select =>
886
888
isStructuralTermSelect(tree)
887
889
case _ =>
888
890
false
889
- }
890
891
loop(tree)
891
892
}
892
893
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