sourcecode icon indicating copy to clipboard operation
sourcecode copied to clipboard

Why doesn't `sourcecode.Args` capture argument values under Scala 3?

Open AdamPaynter opened this issue 5 years ago • 0 comments

Given this method:

  def printArgs(a: Int, b: Long, c: String): Unit = {
    val args = implicitly[sourcecode.Args]
    println(args)
  }

When I call printArgs(1, 2, "3"), the following lines are printed to the console:

Scala 2.13.5

Args(List(List(Text(1,a), Text(2,b), Text(3,c))))

Scala 3.0.0-RC3

Args(List(List(Text(None,a), Text(None,b), Text(None,c))))

I vaguely remember reading somewhere that this is a shortcoming of Scala 3's metaprogramming. Is this correct?

AdamPaynter avatar Apr 24 '21 03:04 AdamPaynter