We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b3dd94f + a5d4098 commit 3ce184fCopy full SHA for 3ce184f
compiler/src/dotty/tools/dotc/ast/TreeInfo.scala
@@ -659,10 +659,8 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
659
rname == tree.name || hasRefinement(parent)
660
case tp: TypeProxy =>
661
hasRefinement(tp.underlying)
662
- case tp: OrType =>
+ case tp: AndOrType =>
663
hasRefinement(tp.tp1) || hasRefinement(tp.tp2)
664
- case tp: AndType =>
665
- hasRefinement(tp.tp1) && hasRefinement(tp.tp2)
666
case _ =>
667
false
668
}
tests/neg/i2871.scala
@@ -0,0 +1,5 @@
1
+class Cont[A0](x0: A0) { type A = A0; val x: A = x0 }
2
+object Test {
3
+ val c: { type A; val x: A } & { type A = Int } = new Cont(1)
4
+ println(c.x : Int) // error: not an instance of Selectable
5
+}
0 commit comments