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
This code (based on i3965.scala; notice the added intersection) should not compile. However, the compiler seems to get in some sort of infinite recursion, runs for a few minutes and then fails with Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded.
Actually, in the first case, the intersection is not important. The problem is that there is a type mismatch and the compiler seems to get stuck trying to produce the error message.
Simplified test:
If I remove the applications of the reported type map in ErrorReporting.Errors.typeMismatchMsg, then I get this type mismatch error:
-- [E007] Type Mismatch Error: i3965Error.scala:8:20 ---------------
8 | optionSequence1(xs2)
| ^^^
|found: Int(xs2)
|required: CC[A]
|
|where: A is a type variable
| CC is a type variable with constraint <: [X] => SortedSetOps[LazyRef(CC), LazyRef(CC[X])]
one error found
That means reported needs some kind of protection against infinite recursion.
panacekcz
changed the title
Out of memory with inferred type lambda and intersection
Out of memory while producing Type Mismatch error message
Nov 17, 2018
This code (based on i3965.scala; notice the added intersection) should not compile. However, the compiler seems to get in some sort of infinite recursion, runs for a few minutes and then fails with
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
.(If
& T
is removed, orwith T
is added toTreeSet
, it compiles fine.)This variant also fails, but it possibly could compile by inferring
CC
to be[X] => (TreeSet[X] & T)
:When the type parameters are specified explicitly,
optionSequence1[[X] => (TreeSet[X] & T), String](xs2)
, it compiles fine.The text was updated successfully, but these errors were encountered: