Commit c9f4222
committed
Fix mixin codegen for an
The `New` is not enough for an `object class Foo$` that is an inner
JS object. It needs the correct wrapping generated by
`ExplicitJSClasses`. That wrapping exists in the `lazy def` defined
in the trait, but cannot be reproduced in the implementing class.
In general, we need full paths to do that, which are long gone.
When extending a Scala 3-defined trait, we can actually generate
a call to the `lazy def`. Although it was never called before (and
still is never called for non-JS objects), it was always generated
by the Scala 3 compilers.
Scala 2, however, does not emit those `lazy def`s. Since I don't
see a way out (yet), we report an "Implementation restriction"
error in that case.object Foo extends js.Any inside a trait.1 parent 7dc3d24 commit c9f4222
1 file changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
276 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
277 | 287 | | |
278 | 288 | | |
279 | 289 | | |
| |||
0 commit comments