Scala Programming Language
  1. Scala Programming Language
  2. SI-6468

Reflection doesn't provide a way to find out values of default arguments

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Reflection
    • Labels:
      None

      Description

      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.

        Activity

        Show
        Eugene Burmako added a comment - Also see http://stackoverflow.com/questions/14034142/how-do-i-access-default-parameter-values-via-scala-reflection
        Hide
        Eugene Burmako added a comment -

        Put this in TermSymbol.getter or create a new method?

        Show
        Eugene Burmako added a comment - Put this in TermSymbol.getter or create a new method?
        Hide
        Eugene Burmako added a comment -

        We don't have time for this in 2.10.1

        Show
        Eugene Burmako added a comment - We don't have time for this in 2.10.1
        Show
        Eugene Burmako added a comment - Also see http://stackoverflow.com/questions/16939511/instantiating-a-case-class-with-default-args-via-reflection

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Eugene Burmako
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:

              Development