Skip to content

Fix #5666: Fix normalizing map when testing for seen pairs #5675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
derefCount += 1
if (derefCount >= DerefLimit) NoType
else try mapOver(t.ref) finally derefCount -= 1
case tp: TypeVar =>
tp
case _ =>
mapOver(t)
}
Expand Down
20 changes: 20 additions & 0 deletions tests/pos/i5666.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// This file should still compile if Config.LogPrendingSubtypesthreshold is set to 9.
sealed trait HList
trait HNil extends HList
trait HCons[+H, +T] extends HList

trait Concat[L1, L2] { type Out }
object Concat {
implicit def i0[L]:
Concat[HNil, L] { type Out = L } = null

implicit def i1[H, T, L, O]
(implicit c: Concat[T, L] { type Out = O }):
Concat[HCons[H, T], L] { type Out = HCons[H, O] } = null
}

object Test {
type L1 = HCons[Unit, HNil]

implicitly[Concat[L1, L1]]
}