Skip to content

Commit a74b213

Browse files
committed
Unwrap NamedType in type mismatch error message
Makes the error message print the actual type instead of scary internal representation. E.g: `Foo(Test.f)` => `Foo`
1 parent 5192eac commit a74b213

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,12 @@ object messages {
293293
)
294294
}
295295

296-
ex"$selected `$name` is not a member of $site$closeMember"
296+
val siteType = site match {
297+
case tp: NamedType => tp.info
298+
case tp => tp
299+
}
300+
301+
ex"$selected `$name` is not a member of $siteType$closeMember"
297302
}
298303

299304
val explanation = ""

0 commit comments

Comments
 (0)