Skip to content

Commit fe9b1a7

Browse files
committed
Print erased|implicit argument lists
1 parent ed60d25 commit fe9b1a7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

library/src/scala/tasty/util/ShowSourceCode.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
5555
this += "."
5656
printImportSelectors(selectors)
5757

58-
case cdef@ClassDef(name, DefDef(_, targs, argss, _, _), parents, self, stats) =>
58+
case cdef @ ClassDef(name, DefDef(_, targs, argss, _, _), parents, self, stats) =>
5959
val flags = cdef.flags
6060
if (flags.isFinal && !flags.isObject) this += "final "
6161
if (flags.isCase) this += "case "
@@ -437,6 +437,12 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
437437

438438
def printArgsDefs(args: List[ValDef]): Unit = {
439439
this += "("
440+
args match {
441+
case Nil =>
442+
case arg :: _ =>
443+
if (arg.flags.isErased) this += "erased "
444+
if (arg.flags.isImplicit) this += "implicit "
445+
}
440446

441447
def printSeparated(list: List[ValDef]): Unit = list match {
442448
case Nil =>

tests/pos/conforms.decompiled

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** Decompiled from out/posTestFromTasty/pos/conforms/Test.class */
2+
object Test {
3+
def f[A, B](x: A)(implicit e: scala.Predef.<:<[A, B]): B = e.apply(x)
4+
}

0 commit comments

Comments
 (0)