File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -407,7 +407,9 @@ object ProtoTypes {
407407 case closureDef(mdef) => hasInnerErrors(mdef.rhs)
408408 case _ =>
409409 t.existsSubTree { t1 =>
410- if t1.typeOpt.isError && t1.span.toSynthetic != t.span.toSynthetic then
410+ if t1.typeOpt.isError
411+ && t.span.toSynthetic != t1.span.toSynthetic
412+ && t.typeOpt != t1.typeOpt then
411413 typr.println(i " error subtree $t1 of $t with ${t1.typeOpt}, spans = ${t1.span}, ${t.span}" )
412414 true
413415 else
Original file line number Diff line number Diff line change 1+ trait Printable {
2+ def pprint (v : () => String ): Unit = {
3+ println(v())
4+ }
5+ }
6+
7+ extension (ctx : Printable )
8+ def pprint (f : () => Int ): Unit = {
9+ ctx.pprint(() => f().toString)
10+ }
11+
12+ val x = new Printable {}
13+
14+ def test =
15+ x.pprint(() => ( 234 ))
16+ x.pprint(() => { 123 })
You can’t perform that action at this time.
0 commit comments