File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,13 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
165
165
// However the original judgment should be true.
166
166
case _ =>
167
167
}
168
- val sym1 = tp1.symbol
168
+ val sym1 =
169
+ if (tp1.symbol.is(ModuleClass ) && tp2.symbol.is(ModuleVal ))
170
+ // For convenience we want X$ <:< X.type
171
+ // This is safe because X$ self-type is X.type
172
+ tp1.symbol.companionModule
173
+ else
174
+ tp1.symbol
169
175
if ((sym1 ne NoSymbol ) && (sym1 eq tp2.symbol))
170
176
ctx.erasedTypes ||
171
177
sym1.isStaticOwner ||
Original file line number Diff line number Diff line change
1
+ case object X
2
+
3
+ object Test {
4
+ val Alias = X
5
+
6
+ val x : X .type = Alias
7
+
8
+ type Alias = X .type
9
+ val a : Alias = Alias
10
+ }
You can’t perform that action at this time.
0 commit comments