Closed
Description
This works in scalac but not in dotty:
case object X
object Test {
val Alias = X
val x: X.type = Alias
}
error: type mismatch:
found : X(Test.Alias)
required: X.type
val x: X.type = Alias
^
Logging shows the issue:
[log frontend] ==> isSubType X$(Test.Alias) <:< X.type class dotty.tools.dotc.core.Types$TermRefWithSignature, class dotty.tools.dotc.core.Types$TermRefWithSignature?
[log frontend] ==> isSubType X$ <:< X.type class dotty.tools.dotc.core.Types$CachedTypeRef, class dotty.tools.dotc.core.Types$TermRefWithSignature?
[log frontend] <== isSubType X$ <:< X.type class dotty.tools.dotc.core.Types$CachedTypeRef, class dotty.tools.dotc.core.Types$TermRefWithSignature = false
[log frontend] <== isSubType X$(Test.Alias) <:< X.type class dotty.tools.dotc.core.Types$TermRefWithSignature, class dotty.tools.dotc.core.Types$TermRefWithSignature = false