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
The compiler crashes with a StackOverflowError during the type-checking phase.
I have attached the source file which causes the crash as well as the output messages emitted by the IDE (IntelliJ) which contains the stacktrace and the details of the error.
The offending bit appears to be the contravariance annotation on the type parameter T for the ObservableTrait. If the annotation is removed or replaced with '+' then the program just doesn't compile which I believe is the right behavior.
The text was updated successfully, but these errors were encountered:
The code in the Main.scala file no longer crashes the compiler, as tested with 2.12.7 and current 2.13.x development version. .
In the 2.13.x, the compiler outputs the following type error:
t7131.scala:27: error: type mismatch;
found : Iterable[U]
required: That
Note: implicit method convertToSimpleMappable is not applicable here because it comes after the application point and it lacks an explicit result type
x.value.map(f)
^
one error found
However, when checking this code in Scala 2.12.7, it gets a different error message:
t7131.scala:5: error: contravariant type T occurs in covariant position in type => T of method value
def value: T
^
one error found
It should be noted that Scala 2.13.x, inside the sbt scala command, rejects the definition of the ObservableValue trait itself, with the same error as the 2.12.8 version.
The compiler crashes with a StackOverflowError during the type-checking phase.
I have attached the source file which causes the crash as well as the output messages emitted by the IDE (IntelliJ) which contains the stacktrace and the details of the error.
The offending bit appears to be the contravariance annotation on the type parameter T for the ObservableTrait. If the annotation is removed or replaced with '+' then the program just doesn't compile which I believe is the right behavior.
The text was updated successfully, but these errors were encountered: