Skip to content

Commit 816489c

Browse files
committed
Fix compilation to dealias types
1 parent 5652ed8 commit 816489c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
193193
"<overloaded " ~ toTextRef(tp) ~ ">"
194194
case tp: TypeRef =>
195195
if (printWithoutPrefix.contains(tp.symbol))
196-
selectionString(tp.dealias)
196+
Str(selectionString(tp))
197197
else
198198
toTextPrefixOf(tp) ~ selectionString(tp)
199199
case tp: TermParamRef =>

tests/neg/i4986c.check

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,7 @@
6161
-- [E172] Type Error: tests/neg/i4986c.scala:62:19 ---------------------------------------------------------------------
6262
62 | i.m[Option[Long]] // error
6363
| ^
64-
| String; List; [A, _] =>> List[Option[?]]; Int; Option[Long];
64+
| String; List; [A, _] =>> List²[Option[?]]; Int; Option[Long];
65+
|
66+
| where: List is a type in package object scala which is an alias of List²
67+
| List² is a class in package scala.collection.immutable

tests/neg/i9958.check

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
8 |def b = f(a) // error
77
| ^
88
| Found: G[[A <: Int] =>> List[A]]
9-
| Required: G[List]
9+
| Required: G[List²]
10+
|
11+
| where: List is a class in package scala.collection.immutable
12+
| List² is a type in package object scala which is an alias of List
1013
|
1114
| longer explanation available when compiling with `-explain`

0 commit comments

Comments
 (0)