We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f6ccc8c + 6985b5d commit f42279dCopy full SHA for f42279d
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -2304,6 +2304,7 @@ object Types {
2304
*/
2305
private def infoDependsOnPrefix(symd: SymDenotation, prefix: Type)(using Context): Boolean =
2306
symd.maybeOwner.membersNeedAsSeenFrom(prefix) && !symd.is(NonMember)
2307
+ || prefix.isInstanceOf[Types.ThisType] && symd.is(Opaque) // see pos/i11277.scala for a test where this matters
2308
2309
/** Is this a reference to a class or object member? */
2310
def isMemberRef(using Context): Boolean = designator match {
tests/pos/i11277.scala
@@ -0,0 +1,8 @@
1
+class Foo {
2
+ opaque type Num = Int
3
+
4
+ val z = Test.id(this)(1)
5
+}
6
+object Test {
7
+ def id(f: Foo)(x: f.Num): f.Num = x
8
0 commit comments