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.
1 parent a6ba33b commit 64e36f1Copy full SHA for 64e36f1
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -3478,7 +3478,7 @@ object Types {
3478
if (selfTypeCache == null)
3479
selfTypeCache = {
3480
val given = cls.givenSelfType
3481
- if (!given.exists) appliedRef
+ if (!given.isValueType) appliedRef
3482
else if (cls is Module) given
3483
else if (ctx.erasedTypes) appliedRef
3484
else AndType(given, appliedRef)
tests/neg/bad-selftype.scala
@@ -0,0 +1,6 @@
1
+trait x0[T] { self: x0 => } // error
2
+
3
+trait x1[T] { self: (=> String) => } // error
4
5
+trait x2[T] { self: ([X] => X) => } // error
6
tests/neg/parser-stability-17.scala
@@ -0,0 +1,2 @@
+trait x0[] { x0: x0 => }
+ class x0[x1] extends x0[x0 x0] x2 x0
0 commit comments