-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Infinite loop in subtyping when a default parameter has an F-bounded type #1103
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
Comments
Compiling with [log frontend] !!! deep subtype recursion involving S <:< de.sciss.lucre.stm.Sys, constraint = ...
exception occurred while typechecking core/src/main/scala/de/sciss/lucre/event/Map.scala |
OK, minimized: class Sys[S]
case class Foo[T <: Sys[T]](t: T) |
Minimized further to not require a case class: class Sys[S]
class Foo[T <: Sys[T]] {
val t: T = ???
def foo[A <: Sys[A]](x: A = t) = x
} |
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Feb 18, 2016
Before this commit, the output of `wildApprox(A)` where `A <: Sys[LazyRef(A)]` was `? <: Sys[LazyRef(() => wildApprox(A))]`. This lead to infinite subtyping checks. This is fixed by always approximating a LazyRef by an unbounded wildcard. Since we only create LazyRefs when we encounter a cycle, this should be safe. Fix scala#1103.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce:
This crashes with the following trace: https://gist.github.com/smarter/975785e299847135de41
The text was updated successfully, but these errors were encountered: