Skip to content

Commit 5ee7b9e

Browse files
committed
Avoid orphan RefinedThis types in glb/lub.
1 parent d1cd3d7 commit 5ee7b9e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
929929
tp1.derivedRefinedType(
930930
tp1.parent & tp2.parent,
931931
tp1.refinedName,
932-
tp1.refinedInfo & tp2.refinedInfo)
932+
tp1.refinedInfo & tp2.refinedInfo.substRefinedThis(tp2, RefinedThis(tp1)))
933933
case _ =>
934934
NoType
935935
}
@@ -995,7 +995,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
995995
tp1.derivedRefinedType(
996996
tp1.parent | tp2.parent,
997997
tp1.refinedName,
998-
tp1.refinedInfo | tp2.refinedInfo)
998+
tp1.refinedInfo | tp2.refinedInfo.substRefinedThis(tp2, RefinedThis(tp1)))
999999
case _ =>
10001000
NoType
10011001
}

src/dotty/tools/dotc/core/tasty/TreePickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class TreePickler(pickler: TastyPickler) {
201201
case tpe: RefinedThis =>
202202
writeByte(REFINEDthis)
203203
val binderAddr = pickledTypes.get(tpe.binder)
204-
assert(binderAddr != null)
204+
assert(binderAddr != null, tpe.binder)
205205
writeRef(binderAddr.asInstanceOf[Addr])
206206
case tpe: SkolemType =>
207207
pickleType(tpe.info)

0 commit comments

Comments
 (0)