Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2503 MOP 2.0 design inflluencing issues
  3. GROOVY-4770

"constructor" in EMC DSL doesn't work as expected

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8-rc-3
    • None
    • groovy-runtime
    • None
    • Mac OS X 10.6.7 / JVM: 1.6.0_24

    Description

      class Foo {}
      Foo.metaClass.constructor =

      { println "in constructor" }
      foo = new Foo()

      This prints "in constructor" as expected.
      But an equivalent EMC DSL:

      Foo.metaClass {
      constructor { println "in constructor" }

      }

      doesn't work. (no output)
      Looks like it's recognized as just a regular method named "constructor".

      Attachments

        Activity

          People

            Unassigned Unassigned
            ksky Kazuchika Sekiya
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: