Skip to content

Commit 0b5d67f

Browse files
Merge pull request #5675 from dotty-staging/fix-#5666
Fix #5666: Fix normalizing map when testing for seen pairs
2 parents ce1086a + d32bd56 commit 0b5d67f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
171171
derefCount += 1
172172
if (derefCount >= DerefLimit) NoType
173173
else try mapOver(t.ref) finally derefCount -= 1
174+
case tp: TypeVar =>
175+
tp
174176
case _ =>
175177
mapOver(t)
176178
}

tests/pos/i5666.scala

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This file should still compile if Config.LogPrendingSubtypesthreshold is set to 9.
2+
sealed trait HList
3+
trait HNil extends HList
4+
trait HCons[+H, +T] extends HList
5+
6+
trait Concat[L1, L2] { type Out }
7+
object Concat {
8+
implicit def i0[L]:
9+
Concat[HNil, L] { type Out = L } = null
10+
11+
implicit def i1[H, T, L, O]
12+
(implicit c: Concat[T, L] { type Out = O }):
13+
Concat[HCons[H, T], L] { type Out = HCons[H, O] } = null
14+
}
15+
16+
object Test {
17+
type L1 = HCons[Unit, HNil]
18+
19+
implicitly[Concat[L1, L1]]
20+
}

0 commit comments

Comments
 (0)