Details

    • Sub-task
    • Status: Closed
    • Critical
    • Resolution: Won't Fix
    • 1.0-JSR-3
    • 1.7-rc-1
    • parser-antlr2
    • None
    • Debian GNU/Linux Testing, JDK 1.5.0_03, Groovy CVS HEAD

    Description

      The Groovy parser currently does not understand the Java syntax needed to instantiate a Java inner class. Groovy does not allow the declaration of inner classes but it must be able to work with inner classes defined in Java. The issue does not affect top-level nested classes only inner classes, i.e. instantiation of classes that have to be instantiated in the context of an existing object. So given the Java class:

      public class X {
      public class Y

      { int z ; }

      }

      the Groovy script:

      def x = new X ( )
      def y = x.new Y ( )

      should either work or there needs to be some new syntax in Groovy to achieve the goal. Currently the result of executing this script is:

      ./test.groovy: 4: unexpected token: new @ line 4, column 11.
      def y = x.new Y ( )
      ^

      1 Error

      which has to be considered wrong I think.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            russel Dr. Russel Winder
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: