Commit bea7430
committed
Fix #4375: Properly erase SeqLiteral
Before this commit, the `SeqLiteral#elems` were typed based on the
SeqLiteral prototype, which means that nothing ensured that the elems
types conformed to the type of `SeqLiteral#elemtpt`. In i4375.scala this
means that erasing `SeqLiteral([1, 2], Object)` did not box each element
because the expected element type was `WildcardType`.
To prevent this sort of issue, we now use the type of SeqLiteral#elemtpt
if it exists as the expected type of each element in the sequence.1 parent e77604d commit bea7430
File tree
2 files changed
+34
-10
lines changed- compiler/src/dotty/tools/dotc/typer
- tests/pos
2 files changed
+34
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1126 | 1126 | | |
1127 | 1127 | | |
1128 | 1128 | | |
1129 | | - | |
| 1129 | + | |
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
1133 | 1133 | | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
1143 | 1154 | | |
1144 | 1155 | | |
1145 | 1156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments