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 {
407
407
case closureDef(mdef) => hasInnerErrors(mdef.rhs)
408
408
case _ =>
409
409
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
411
413
typr.println(i " error subtree $t1 of $t with ${t1.typeOpt}, spans = ${t1.span}, ${t.span}" )
412
414
true
413
415
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