groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graeme Rocher (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-7402) Compiler NPE Related To AST Transformations And Traits
Date Mon, 01 Jun 2015 07:40:19 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-7402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14567026#comment-14567026
] 

Graeme Rocher commented on GROOVY-7402:
---------------------------------------

Understood, I guess the confusion here from the user perspective is it works in a previous
version of Groovy. If it isn't going to be allowed I would suggest a better compilation error

> Compiler NPE Related To AST Transformations And Traits
> ------------------------------------------------------
>
>                 Key: GROOVY-7402
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7402
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.3
>            Reporter: Jeff Scott Brown
>         Attachments: traitannotation.zip
>
>
> Related to https://github.com/grails/grails-core/issues/663.
> The attached traitannotation.zip includes the following:
> {code:title=src/main/groovy/demo/SomeTrait.groovy|borderStyle=solid}
> package demo
> import groovy.transform.*
> @Immutable
> trait SomeTrait {
>     String name
> }
> {code}
> {code:title=src/main/groovy/demo/SomeClass.groovy|borderStyle=solid}
> package demo
> class SomeClass implements SomeTrait {}
> {code}
> Compilation raises an NPE:
> {noformat}
> $ ./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
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message