Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ object ProtoTypes {
case closureDef(mdef) => hasInnerErrors(mdef.rhs)
case _ =>
t.existsSubTree { t1 =>
if t1.typeOpt.isError && t1.span.toSynthetic != t.span.toSynthetic then
if t1.typeOpt.isError
&& t.span.toSynthetic != t1.span.toSynthetic
&& t.typeOpt != t1.typeOpt then
typr.println(i"error subtree $t1 of $t with ${t1.typeOpt}, spans = ${t1.span}, ${t.span}")
true
else
Expand Down
16 changes: 16 additions & 0 deletions tests/pos/i18645.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
trait Printable {
def pprint(v: () => String): Unit = {
println(v())
}
}

extension (ctx: Printable)
def pprint(f: () => Int): Unit = {
ctx.pprint(() => f().toString)
}

val x = new Printable {}

def test =
x.pprint(() => ( 234 ))
x.pprint(() => { 123 })