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

arithmetic using an implicit getter fails to compile with "BUG! exception in phase 'class generation'" under static compilation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0.5, 3.0.6, 3.0.7
    • 2.5.15, 3.0.8, 4.0.0-alpha-3
    • Compiler
    • None

    Description

      The following code:

      package example
      
      import groovy.transform.CompileStatic
      
      @CompileStatic
      class ImplicitGetterExample {
         double getSomeValue() {
            return 0.0d
         }
      
         void example() {
            1.0d + someValue
         }
      }
      

      fails to compile with this message:

      BUG! exception in phase 'class generation' in source unit '/Users/jasongarrett/scratch/scratch/src/main/groovy/example/ImplicitGetterExample.groovy' At line 12 column 3
      On receiver: 1.0 with message: plus and arguments: someValue
      This method should not have been called. Please try to create a simple example reproducing
      this error and file a bug report at https://issues.apache.org/jira/browse/GROOVY

      This class compiles successfully with versions 3.0.4 and earlier.

      Attachments

        Activity

          People

            emilles Eric Milles
            jasongarrett Jason Garrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h