Commit 212211d
committed
Previously, i9994.scala failed when compiled with `-Ythrough-tasty`
with:
7 | def foo: this.type = this
| ^
| error overriding method foo in trait Foo of type => (Bar.this : pkg.Bar);
| method foo of type => (Bar.this : pkg.Bar) has incompatible type
The two types were pretty-printed the same but were actually:
ExprType(ThisType(TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <root>)),module class <empty>)),class Bar)))
and
ExprType(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),class Bar)))
Fixed by explicitly handling subtyping between two
`ThisType` (previously we felt through to `fourthTry` were the type of
the lhs was widened), this is a rare case because `ThisType` are
interned, so usually two `ThisType` to the same class are `eq` and
therefore `isSubType` returns true.
1 parent 6098ec2 commit 212211d
File tree
3 files changed
+9
-49
lines changed- compiler/src/dotty/tools/dotc/core
- stdlib-bootstrapped-tasty-tests/test
- tests/pos
3 files changed
+9
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
313 | 315 | | |
314 | 316 | | |
315 | 317 | | |
| |||
Lines changed: 0 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 152 | | |
202 | 153 | | |
203 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments