Commit 5cf6707
committed
fix(#i18645): overload ext method body in braces didn't compile
`tryWithImplicitOnQualifier` returned without attempting `tryInsertImplicitOnQualifier`,
which prevented the compiler from finding overloaded method, because `hasInnerErrors`
in `ProtoTypes` picked up the inner error propagated back from outer error.
When compiling `x.pprint(()=> { 123 })` before this commit, in `hasInnerErrors`,
`t` contains two sub trees; `Block(stmt, expr)` and `stmt`. The span of the former matches
the span of `t`, but that of the latter does not, which caused `hasInnerErrors` to return `true`,
but the error from the latter is duplicated with the error of parent tree `t`.1 parent 95266f2 commit 5cf6707
File tree
2 files changed
+19
-1
lines changed- compiler/src/dotty/tools/dotc/typer
- tests/pos
2 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
411 | 413 | | |
412 | 414 | | |
413 | 415 | | |
| |||
| 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 | + | |
| 16 | + | |
0 commit comments