Commit 3e283a7
committed
Make sure annotations are typed in expression contexts
The previous logic tried but had holes. A local context was
established in `typedStats#localCtx` but that context was not
found in annotations that were typechecked in the completer
of the definition they decorated.
We are now more through and always allocate a localDummy as
new owner if the owner would otherwise we a class. This means
that closures in annotation arguments will have a term as owner,
and therefore will be allocated in distinct local scopes.
Fixes #150541 parent ed81385 commit 3e283a7
File tree
3 files changed
+28
-13
lines changed- compiler/src/dotty/tools/dotc
- core/tasty
- typer
- tests/pos
3 files changed
+28
-13
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
628 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
629 | 631 | | |
630 | 632 | | |
631 | 633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2238 | 2238 | | |
2239 | 2239 | | |
2240 | 2240 | | |
2241 | | - | |
| 2241 | + | |
2242 | 2242 | | |
2243 | 2243 | | |
2244 | | - | |
| 2244 | + | |
2245 | 2245 | | |
2246 | 2246 | | |
2247 | 2247 | | |
| 2248 | + | |
2248 | 2249 | | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
2253 | | - | |
2254 | | - | |
2255 | | - | |
2256 | | - | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
2257 | 2256 | | |
2258 | | - | |
2259 | | - | |
| 2257 | + | |
2260 | 2258 | | |
2261 | 2259 | | |
2262 | 2260 | | |
| |||
| 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 | + | |
0 commit comments