File tree 2 files changed +26
-2
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -541,9 +541,11 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
541
541
/** if `tp2 == p.type` and `p: q.type` then try `tp1 <:< q.type` as a last effort.*/
542
542
def comparePaths = tp2 match {
543
543
case tp2 : TermRef =>
544
- tp2.info.widenExpr match {
544
+ tp2.info.widenExpr.dealias match {
545
545
case tp2i : SingletonType =>
546
- isSubType(tp1, tp2i) // see z1720.scala for a case where this can arise even in typer.
546
+ isSubType(tp1, tp2i)
547
+ // see z1720.scala for a case where this can arise even in typer.
548
+ // Also, i1753.scala, to show why the dealias above is necessary.
547
549
case _ => false
548
550
}
549
551
case _ =>
Original file line number Diff line number Diff line change
1
+ abstract class BackendInterface {
2
+ type Symbol >: Null
3
+ type ClassDef >: Null
4
+ }
5
+
6
+ class BTypesFromSymbols [I <: BackendInterface ](val int : I ) {
7
+ def isRemote (s : int.Symbol ) = println(" might've been remote" )
8
+ }
9
+
10
+ trait BCodeIdiomatic {
11
+ val int : BackendInterface
12
+ final lazy val bTypes = new BTypesFromSymbols [int.type ](int)
13
+ }
14
+
15
+ trait BCodeSkelBuilder extends BCodeIdiomatic {
16
+ import int ._
17
+ import bTypes ._
18
+ val b : BTypesFromSymbols [int.type ] = bTypes
19
+ val x : int.type = bTypes.int
20
+ val y : bTypes.int.type = int
21
+ def getPlainClass (cd : ClassDef ) = bTypes.isRemote(null : Symbol )
22
+ }
You can’t perform that action at this time.
0 commit comments