Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1957

Dynamically added static getters can't be called as properties

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1-beta-2
    • Fix Version/s: 1.1-beta-3
    • Component/s: None
    • Labels:
      None

      Description

      String.metaClass."static".getSomething <<

      { -> "something" }

      assertEquals("something", String.something)

      This fails with "No such property: something for class: java.lang.Class"

        Attachments

          Activity

            People

            • Assignee:
              graemerocher Graeme Rocher
              Reporter:
              ldaley Luke Daley
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: