Commit 2c7b12f
committed
Fix #23179 for Scala.js and add regression tests
- Guard the Erasure.scala array adaptation check with !scalajs.value
since Scala.js custom SAMs are handled differently (via ExpandSAMs)
- Add array type adaptation in tpd.AnonClass for Scala.js, which handles
custom SAM closures that get expanded to anonymous classes before erasure
- Add neg test documenting that reverse cases (impl has Array, SAM erases
to Object) are rejected by the type checker due to array invariance1 parent e70c4a7 commit 2c7b12f
File tree
3 files changed
+55
-9
lines changed- compiler/src/dotty/tools/dotc
- ast
- transform
- tests/neg
3 files changed
+55
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
398 | 420 | | |
399 | 421 | | |
400 | 422 | | |
401 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
402 | 429 | | |
403 | 430 | | |
404 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
492 | 489 | | |
493 | 490 | | |
494 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments