File tree 4 files changed +15
-2
lines changed
compiler/src/dotty/tools/dotc
4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
177
177
" <overloaded " ~ toTextRef(tp) ~ " >"
178
178
case tp : TypeRef =>
179
179
if (printWithoutPrefix.contains(tp.symbol))
180
- toText (tp.name )
180
+ selectionString (tp)
181
181
else
182
182
toTextPrefixOf(tp) ~ selectionString(tp)
183
183
case tp : TermParamRef =>
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ object Message:
81
81
def followAlias (e1 : Recorded ): Recorded = e1 match {
82
82
case e1 : Symbol if e1.isAliasType =>
83
83
val underlying = e1.typeRef.underlyingClassRef(refinementOK = false ).typeSymbol
84
- if (underlying.name == e1.name) underlying else e1
84
+ if (underlying.name == e1.name) underlying else e1.namedType.dealias.typeSymbol
85
85
case _ => e1
86
86
}
87
87
val key = SeenKey (str, isType)
Original file line number Diff line number Diff line change
1
+ -- [E007] Type Mismatch Error: tests/neg/i18678b.scala:3:16 ------------------------------------------------------------
2
+ 3 |def s: String = "" // error
3
+ | ^^
4
+ | Found: ("" : String)
5
+ | Required: String²
6
+ |
7
+ | where: String is a class in package java.lang
8
+ | String² is a class in the empty package
9
+ |
10
+ | longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change
1
+ class String
2
+
3
+ def s : String = " " // error
You can’t perform that action at this time.
0 commit comments