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

Groovyc ant task (and eclipse groovy plugin) reports compile error on declaring type on lhs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.0-JSR-2
    • 1.0-JSR-3
    • None
    • None
    • JSR02, Ant v1.6.4

    Description

      This simple code does not compile with groovyc ant task, nor does it compile from within eclipse (the groovy eclipse plugin):

      package groovy.test;
      import groovy.mock.GroovyMock

      class UsingExternalLib {
      static void main(args)

      { GroovyMock mock = GroovyMock.newInstance() def mock2 = GroovyMock.newInstance() }

      }

      The error reported from ant is:

      General error during class generation: No such class: groovy.mock.GroovyMock in cast for class: groovy.test.UsingExternalLib. At [-1:-1] /home/meling/work/runtime-EclipseApplication/Test/src/groovy/test/UsingExternalLib.groovy

      The same message is also reported from the eclipse groovy plugin.

      The ODD THING is that the groovyc command line compiles this code just fine.

      In all cases I used jsr-02 version.

      Also, if I comment the first line within main(), it does compile also with ant and eclipse. Thus, it appears that the compiler is not dealing with declaring type on the lhs...

      Attachments

        1. build.xml
          0.7 kB
          Hein Meling
        2. build.xml
          0.7 kB
          Hein Meling
        3. groovyc-ant-task-patch.txt
          4 kB
          Hein Meling

        Activity

          People

            meling Hein Meling
            meling Hein Meling
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: