Skip to content

Commit 7c0ff57

Browse files
committed
Fix dealiasing of types which caused test failures in TypeMismatch errors
1 parent d2f1380 commit 7c0ff57

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
193193
"<overloaded " ~ toTextRef(tp) ~ ">"
194194
case tp: TypeRef =>
195195
if (printWithoutPrefix.contains(tp.symbol))
196-
selectionString(tp.dealias.typeSymbol.namedType)
196+
selectionString(tp)
197197
else
198-
toTextPrefixOf(tp) ~ selectionString(tp.dealias.typeSymbol.namedType)
198+
toTextPrefixOf(tp) ~ selectionString(tp)
199199
case tp: TermParamRef =>
200200
ParamRefNameString(tp) ~ lambdaHash(tp.binder) ~ ".type"
201201
case tp: TypeParamRef =>

compiler/src/dotty/tools/dotc/reporting/Message.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ object Message:
8888
def followAlias(e1: Recorded): Recorded = e1 match {
8989
case e1: Symbol if e1.isAliasType =>
9090
val underlying = e1.typeRef.underlyingClassRef(refinementOK = false).typeSymbol
91-
if (underlying.name == e1.name) underlying else e1
91+
if (underlying.name == e1.name) underlying else e1.namedType.dealias.typeSymbol
9292
case _ => e1
9393
}
9494
val key = SeenKey(str, isType)

0 commit comments

Comments
 (0)