You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:NewDefs:GADTsabstractclassFoo[typeT]:Bar|BazclassBarextendsFoo[Int]
classBaz[T](valx:Foo[T]) extendsFoo[[T]]
fun foo[T](f: Foo[T]):Int=if f is
Barthen0Baz(x) then foo(x : Foo[x.T])
//│ ╔══[ERROR] Subtyping constraint of the form `([?a]) -> ?b <: ?c -> ?d` exceeded recursion depth limit (250)//│ ║ l.14: fun foo[T](f: Foo[T]): Int = if f is//│ ║ ^^^^//│ ║ l.15: Bar then 0//│ ║ ^^^^^^^^^^^^^^//│ ║ l.16: Baz(x) then foo(x : Foo[x.T])//│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^//│ ╙── Note: use flag `:ex` to see internal error info.// (some more errors)
The text was updated successfully, but these errors were encountered:
classBox[typeA](valget:A)
abstractclassF[typeA]:MkFclassMkF[T](t: T) extendsF[Box[T]]
fun f[T](x: F[T]):T=if x is MkF(t) thenBox(t) as x.A//│ ╔══[ERROR] Subtyping constraint of the form `?a <: ?b` exceeded recursion depth limit (250)//│ ╙── Note: use flag `:ex` to see internal error info.//│ fun f: forall 'T. (x: F['T]) -> 'T
So as we've discussed before, this seems to be happening during reconstraining after type extrusion. Recornstraining is basically a hacky plug on top of extrusion to detect type mismatches introduced by approximated skolems (in the context of first-class polymorphism).
The solution is not a low-hanging fruit. We need to rearchitect extrusion so it's done in a more principled way, accumulating all level-mismatched bounds first and extruding them all together, only reconstraining what's actually neede.
In cb89a08
The text was updated successfully, but these errors were encountered: