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
I tried to make a minimized example based on the code in Scala.js, not sure how accurate (or if it is even valid code), but this makes dotty compiler crash, while it compiles in Scala 2.
It is a best effort reimplementation of the code in Scala.js. I also encountered something that looks similar when trying to upgrade the scala-dom-types library. This does not compile:
// Does not compiletraitErrorEventProps[EP[_ <:DomEvent], DomEvent, DomErrorEvent<:DomEvent] { this:EventPropBuilder[EP, DomEvent] =>// Defining it like this compilestraitErrorEventProps[A, EP[A<:DomEvent], DomEvent, DomErrorEvent<:DomEvent] { this:EventPropBuilder[EP, DomEvent] =>
I will try to find time looking more deeply into the language specification, so that I can make these bug reports a bit more precise. Thank you very much for the very supportive feedback so far.
The text was updated successfully, but these errors were encountered:
Fixesscala#11064
When comparing a LazyRef with some other type, we need to force the LazyRef
which can potentially lead to a cycle (as observed in scala#11064). However, in the situations
```
Nothing <: LazyRef(...)
LazyRef(...) <: Any
```
we can skip that since the comparison is always true. This scheme fixesscala#11064, but it breaks
down in similar situations if additional bounds are introduced (see neg/i11064.scala).
So it is quite fragile. But it's probably the best we can do.
The example in scala#11064 looks harmless, but type-theoretically it's actually a pretty explosive
mix of F-bounded types and existential types (in Scala 2). In Scala 2, we need to force more
for F-bounded types and we need to approximate existential types by dependent types, so
not everything works the same way.
My long term advice would be: get rid of F-bounds. Model them with intersections at the
use site.
Minimized code
In a Scala.js project add the following code snippet :
Output
Expectation
This should compile. Looking at several Scala.js libraries, building structures like done in the TypedArray seems to be used a lot.
Other comments
I encountered this when trying to update
scalajs-dom
library toScala 3.0.0-M3
, the working branch is here:I tried to make a minimized example based on the code in Scala.js, not sure how accurate (or if it is even valid code), but this makes dotty compiler crash, while it compiles in Scala 2.
It is a best effort reimplementation of the code in Scala.js. I also encountered something that looks similar when trying to upgrade the
scala-dom-types
library. This does not compile:working on the branch here:
I will try to find time looking more deeply into the language specification, so that I can make these bug reports a bit more precise. Thank you very much for the very supportive feedback so far.
The text was updated successfully, but these errors were encountered: