Commit d0fb2b3
authored
fix scala 2 macros in traits with type parameters (#18663)
Fixes #16630
This PR fixes the above issue which affects cross scala2/3 projects that
use a common macro library as per
https://docs.scala-lang.org/scala3/guides/migration/tutorial-macro-mixing.html
, e.g. scala-logging is blocked from fixing this issue
lightbend-labs/scala-logging#317
The fix makes the scala 2 macro check read the Erased flag from the
initial flags rather than completing the RHS first. This will work in
the case of scala 2 macros because the erased flag is explicitly added
rather than being in the source code. However it relies on using an
"UNSAFE" value.File tree
2 files changed
+15
-1
lines changed- compiler/src/dotty/tools/dotc/core
- tests/pos-macros
2 files changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
1033 | | - | |
| 1033 | + | |
1034 | 1034 | | |
1035 | 1035 | | |
1036 | 1036 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments