Commit b429e6b
committed
Check realizability of parameters of an erased function
... instead of checking every instantiated instance of erasedValue[T].
I think this is the better solution, since erasedValue have uses outside
of erasedDefinitions (i.e. in inlining) which has their own realizability checks
as well. We don't have to be pessimistic in those cases.
- Only check for realizability for erased parameters of result-dependent functions.
Per talk with @odersky, it seems that it is enough to check for
realizability of parameters of a dependent function in order to avoid
unsoundness.
Note that the following actions have already been checked for,
with erased parameters:
- Using them as a dependent path in casting / variable definitions
- Using them as the input to an `inline match`
The check previously performed on `val`/`def` definitions are also
removed, so we are as liberal as possible, to avoid too much restriction.
I think with this, we can also remove the special case for `compiletime.erasedValue`.1 parent f18465b commit b429e6b
File tree
2 files changed
+4
-10
lines changed- compiler/src/dotty/tools/dotc/transform
- tests/neg-custom-args/erased
2 files changed
+4
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| 311 | + | |
| 312 | + | |
311 | 313 | | |
312 | 314 | | |
313 | 315 | | |
| |||
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | 355 | | |
359 | 356 | | |
360 | 357 | | |
| |||
489 | 486 | | |
490 | 487 | | |
491 | 488 | | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | 489 | | |
496 | 490 | | |
497 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments