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 @@ -394,7 +394,9 @@ object ProtoTypes {
394
394
case closureDef(mdef) => hasInnerErrors(mdef.rhs)
395
395
case _ =>
396
396
t.existsSubTree { t1 =>
397
- if t1.typeOpt.isError && t1.span.toSynthetic != t.span.toSynthetic then
397
+ if t1.typeOpt.isError
398
+ && t.span.toSynthetic != t1.span.toSynthetic
399
+ && t.typeOpt != t1.typeOpt then
398
400
typr.println(i " error subtree $t1 of $t with ${t1.typeOpt}, spans = ${t1.span}, ${t.span}" )
399
401
true
400
402
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