bug
bug copied to clipboard
Reflection doesn't provide a way to find out values of default arguments
We could at least expose the defaultGetter method from NamesDefaults.scala: https://github.com/scala/scala/blob/f5357d98a2adfada4998fcdaea680ddc6d8460f8/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala#L424.
Not sure how invocations will work though, because they might need stuff from lexical scope.
Imported From: https://issues.scala-lang.org/browse/SI-6468?orig=1 Reporter: @xeno-by
@xeno-by said: Also see http://stackoverflow.com/questions/14034142/how-do-i-access-default-parameter-values-via-scala-reflection
@xeno-by said: Put this in TermSymbol.getter or create a new method?
@xeno-by said: We don't have time for this in 2.10.1
@xeno-by said: Also see http://stackoverflow.com/questions/16939511/instantiating-a-case-class-with-default-args-via-reflection
Scala 3 equivalent issue: https://github.com/scala/scala3/discussions/17893