Commit 79500f7
authored
Fix the visibility check in
Fixes #20169. Fixes #20224.
It turns out that the type argument in #20169 is properly boxed. It is
just that when doing box adaptation, when charging `cap` into
environments it gets discarded by the visibility check.
Right now, a symbol is considered visible in an environment only when
the owner of the environment is contained in the symbol. This is not
right: when there is not containment relation between the symbol and the
environment owner the symbol is also visible from the environment, which
is the case here for `cap`.markFree (#20221)File tree
4 files changed
+55
-5
lines changed- compiler/src/dotty/tools/dotc/cc
- tests/neg-custom-args/captures
4 files changed
+55
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
363 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
364 | 372 | | |
365 | 373 | | |
366 | 374 | | |
| |||
378 | 386 | | |
379 | 387 | | |
380 | 388 | | |
| 389 | + | |
381 | 390 | | |
382 | 391 | | |
383 | 392 | | |
| |||
946 | 955 | | |
947 | 956 | | |
948 | 957 | | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
949 | 971 | | |
950 | 972 | | |
951 | 973 | | |
| |||
1085 | 1107 | | |
1086 | 1108 | | |
1087 | 1109 | | |
| 1110 | + | |
1088 | 1111 | | |
1089 | 1112 | | |
1090 | 1113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
415 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
416 | 420 | | |
417 | 421 | | |
418 | 422 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments