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

Compiler NPE Related To AST Transformations And Traits

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.3
    • 2.4.10
    • Compiler
    • None

    Description

      Related to https://github.com/grails/grails-core/issues/663.

      The attached traitannotation.zip includes the following:

      src/main/groovy/demo/SomeTrait.groovy
      package demo
      
      import groovy.transform.*
      
      @Immutable
      trait SomeTrait {
          String name
      }
      
      src/main/groovy/demo/SomeClass.groovy
      package demo
      
      class SomeClass implements SomeTrait {}
      

      Compilation raises an NPE:

      $ ./gradlew clean cG
      :clean
      :compileJava UP-TO-DATE
      :compileGroovy FAILED
      
      FAILURE: Build failed with an exception.
      
      * What went wrong:
      Execution failed for task ':compileGroovy'.
      > BUG! exception in phase 'instruction selection' in source unit '/Users/jeff/traitannotation/src/main/groovy/demo/SomeTrait.groovy' unexpected NullpointerException
      
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
      
      BUILD FAILED
      

      Attachments

        1. traitannotation.zip
          50 kB
          Jeff Scott Brown

        Issue Links

          Activity

            People

              paulk Paul King
              jeffscottbrown Jeff Scott Brown
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: