Commit b8fb81b
authored
Set the inlining phase in the Context used for checking macro trees (#20087)
Fixes #17009
The problem here was with the sub typing check for `line.split(" ").nn`,
which needed to confirm that:
```scala
(?2 : Array[String]) & Array[String] <: (?1 : Array[String]) & Array[String]
```
`TypeComparer` would eventually try to compare two skolem types:
```scala
(?2 : Array[String]) <: (?1 : Array[String])
```
The behavior of `TypeComparer` differs here when executed during the
typer phase, where it always returns false for two skolem types, without
checking the sub typing further. This makes sense for Typer, but not so
much for the macro checks, which for `transparent inline`s end up being
executed during Typer. I think the best solution here is to artificially
change the phase in the checkingContext, so the checks done for
transparent and non-transparent macros are the same.File tree
3 files changed
+22
-0
lines changed- compiler/src/dotty/tools/dotc/transform
- tests/pos-macros/i17009
3 files changed
+22
-0
lines changedLines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
840 | 848 | | |
841 | 849 | | |
842 | 850 | | |
| 851 | + | |
| 852 | + | |
843 | 853 | | |
844 | 854 | | |
845 | 855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments