Skip to content

Commit e3288d2

Browse files
committed
Formatting of anon terms
1 parent eb3638c commit e3288d2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

modules/unpickler/src/main/scala/ch/epfl/scala/debugadapter/internal/stacktrace/Scala3Formatter.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class Scala3Formatter(warnLogger: String => Unit, testMode: Boolean)(using Conte
9292
case SimpleName("$anonfun") => "<anon fun>"
9393
case SimpleName("$anon") => "<anon class>"
9494
case ObjectClassName(underlying) => rec(underlying)
95+
case UniqueName(SimpleName(""), _, _) => "<anon>"
9596
case _ => name.toString
9697
rec(name)
9798

modules/unpickler/src/test/scala/ch/epfl/scala/debugadapter/internal/stacktrace/Scala3UnpicklerTests.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,25 +1657,25 @@ abstract class Scala3UnpicklerTests(val scalaVersion: ScalaVersion) extends FunS
16571657
|""".stripMargin
16581658
val debuggee = TestingDebuggee.mainClass(source, "example", scalaVersion)
16591659
if isScala30 then
1660-
debuggee.assertFormat("example.A", "scala.Tuple2 $1$()", "A.$1: (String, String)", skip = true)
1660+
debuggee.assertFormat("example.A", "scala.Tuple2 $1$()", "A.<anon>: (String, String)", skip = true)
16611661
debuggee.assertFormat(
16621662
"example.A",
16631663
"scala.Tuple2 $2$$lzyINIT1$1(scala.runtime.LazyRef $2$$lzy1$1)",
1664-
"A.m.$2.<lazy init>: (String, String)"
1664+
"A.m.<anon>.<lazy init>: (String, String)"
16651665
)
16661666
debuggee.assertNotFound("example.A", "scala.Tuple2 $3$$1(scala.runtime.LazyRef $2$$lzy1$2)")
16671667
else
1668-
debuggee.assertFormat("example.A", "java.lang.Object $1$$lzyINIT1()", "A.$1.<lazy init>: (String, String)")
1669-
debuggee.assertFormat("example.A", "scala.Tuple2 $1$()", "A.$1: (String, String)", skip = true)
1668+
debuggee.assertFormat("example.A", "java.lang.Object $1$$lzyINIT1()", "A.<anon>.<lazy init>: (String, String)")
1669+
debuggee.assertFormat("example.A", "scala.Tuple2 $1$()", "A.<anon>: (String, String)", skip = true)
16701670
debuggee.assertFormat(
16711671
"example.A",
16721672
"scala.Tuple2 $2$$lzyINIT1$1(scala.runtime.LazyRef $2$$lzy1$1)",
1673-
"A.m.$2.<lazy init>: (String, String)"
1673+
"A.m.<anon>.<lazy init>: (String, String)"
16741674
)
16751675
debuggee.assertFormat(
16761676
"example.A",
16771677
"scala.Tuple2 $2$$1(scala.runtime.LazyRef $2$$lzy1$2)",
1678-
"A.m.$2: (String, String)",
1678+
"A.m.<anon>: (String, String)",
16791679
skip = true
16801680
)
16811681
}

0 commit comments

Comments
 (0)