Skip to content

Commit da0b6ba

Browse files
Print and highlight erased arguments
1 parent 7e9f3e7 commit da0b6ba

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
169169
"<noprefix>"
170170
case tp: MethodType =>
171171
changePrec(GlobalPrec) {
172-
(if (tp.isImplicitMethod) "(implicit " else "(") ~ paramsText(tp) ~
172+
("(" + (if (tp.isErasedMethod) "erased " else "")
173+
+ (if (tp.isImplicitMethod) "implicit " else "")
174+
) ~ paramsText(tp) ~
173175
(if (tp.resultType.isInstanceOf[MethodType]) ")" else "): ") ~
174176
toText(tp.resultType)
175177
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object SyntaxHighlighting {
3131
private val tripleQs = Console.RED_B + "???" + NoColor
3232

3333
private val keywords: Seq[String] = for {
34-
index <- IF to ENUM // All alpha keywords
34+
index <- IF to ERASED // All alpha keywords
3535
} yield tokenString(index)
3636

3737
private val interpolationPrefixes =

compiler/test-resources/repl/erased

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
scala> def f(erased a: Int): Int = ???
2+
def f(erased a: Int): Int
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
scala> def f(erased implicit a: Int): Int = ???
2+
def f(erased implicit a: Int): Int

0 commit comments

Comments
 (0)