[jira] [Commented] (GROOVY-8753) Compiler error in STC: exception in phase 'instruction selection'

2018-08-20 Thread Patric Bechtel (JIRA)


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

Patric Bechtel commented on GROOVY-8753:


Strike :)

That did the trick. Checking the docs, this cache even survives a clean... wtf? 
Isn't there a trick to make clean drop the build cache, too?

Thanks a lot, though. Am I the only one ever stumbled over that?

> Compiler error in STC: exception in phase 'instruction selection'
> -
>
> Key: GROOVY-8753
> URL: https://issues.apache.org/jira/browse/GROOVY-8753
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.5.2
> Environment: Java 8u181, Ubuntu 18.04
>Reporter: Patric Bechtel
>Assignee: Paul King
>Priority: Critical
> Fix For: 3.0.0-alpha-4, 2.5.3
>
>
> Following source compiles under 2.5.1 and 3.0alpha3, but not 2.5.2:
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    private List fooNames = []
>    public A(Collection names) {
>   names.each { fooNames << it }
>    }
>    public List getFooNames() { fooNames }
> }
> {code}
> error message is:
> {noformat}
> >>> a serious error occurred: BUG! exception in phase 'instruction selection' 
> >>> in source unit 'A.groovy' Tried to overwrite existing meta data 
> >>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> >>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> >>> property: ConstantExpression[fooNames]].
> >>> stacktrace:
> BUG! exception in phase 'instruction selection' in source unit 'A.groovy' 
> Tried to overwrite existing meta data 
> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> property: ConstantExpression[fooNames]].
>     at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
>     at 
> org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
>     at 
> org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:785)
>     at 
> org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:122)
>     at 
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
>     at 
> org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:88)
>     at 
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBlockStatement(StaticTypeCheckingVisitor.java:3628)
>     at 
> org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitClosureExpression(CodeVisitorSupport.java:227)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClosureExpression(StaticTypeCheckingVisitor.java:2286)
>     at 
> org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:49)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallArguments(StaticTypeCheckingVisitor.java:2596)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallExpression(StaticTypeCheckingVisitor.java:3286)
>     at 
> org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethodCallExpression(StaticCompilationVisitor.java:397)
>     at 
> 

[jira] [Comment Edited] (GROOVY-8753) Compiler error in STC: exception in phase 'instruction selection'

2018-08-20 Thread Patric Bechtel (JIRA)


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

Patric Bechtel edited comment on GROOVY-8753 at 8/20/18 11:01 PM:
--

Just tried:
{noformat}
LANG=C git status{noformat}
{noformat}
On branch GROOVY_2_5_X
Your branch is up to date with 'origin/GROOVY_2_5_X'.

Untracked files:
  (use "git add ..." to include in what will be committed)

    A.groovy

nothing added to commit but untracked files present (use "git add" to track)
{noformat}
{noformat}
git pull; ./gradlew clean; ./gradlew installGroovy; 
{noformat}
{noformat}
java -cp target/install/lib/groovy-2.5.3-SNAPSHOT.jar 
org.codehaus.groovy.tools.FileSystemCompiler A.groovy{noformat}
results in
{noformat}
>>> a serious error occurred: BUG! exception in phase 'instruction selection' 
>>> in source unit 'A.groovy' Tried to overwrite existing meta data 
>>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
>>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
>>> property: ConstantExpression[fooNames]].
>>> stacktrace:
BUG! exception in phase 'instruction selection' in source unit 'A.groovy' Tried 
to overwrite existing meta data 
org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] property: 
ConstantExpression[fooNames]].
    at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
    at 
org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
    at 
org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
{noformat}
Oracle Java 8u181, Ubuntu 18.04.

*sigh*... wtf?

 


was (Author: patric42):
Just tried:
{noformat}
LANG=C git status{noformat}
{noformat}
On branch GROOVY_2_5_X
Your branch is up to date with 'origin/GROOVY_2_5_X'.

Untracked files:
  (use "git add ..." to include in what will be committed)

    A.groovy

nothing added to commit but untracked files present (use "git add" to track)
{noformat}
{noformat}
git pull; ./gradlew clean; gradlew installGroovy; 
{noformat}
{noformat}
java -cp target/install/lib/groovy-2.5.3-SNAPSHOT.jar 
org.codehaus.groovy.tools.FileSystemCompiler A.groovy{noformat}
results in
{noformat}
>>> a serious error occurred: BUG! exception in phase 'instruction selection' 
>>> in source unit 'A.groovy' Tried to overwrite existing meta data 
>>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
>>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
>>> property: ConstantExpression[fooNames]].
>>> stacktrace:
BUG! exception in phase 'instruction selection' in source unit 'A.groovy' Tried 
to overwrite existing meta data 
org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] property: 
ConstantExpression[fooNames]].
    at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
    at 
org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
    at 

[jira] [Comment Edited] (GROOVY-8753) Compiler error in STC: exception in phase 'instruction selection'

2018-08-20 Thread Patric Bechtel (JIRA)


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

Patric Bechtel edited comment on GROOVY-8753 at 8/20/18 11:00 PM:
--

Just tried:
{noformat}
LANG=C git status{noformat}
{noformat}
On branch GROOVY_2_5_X
Your branch is up to date with 'origin/GROOVY_2_5_X'.

Untracked files:
  (use "git add ..." to include in what will be committed)

    A.groovy

nothing added to commit but untracked files present (use "git add" to track)
{noformat}
{noformat}
git pull; ./gradlew clean; gradlew installGroovy; 
{noformat}
{noformat}
java -cp target/install/lib/groovy-2.5.3-SNAPSHOT.jar 
org.codehaus.groovy.tools.FileSystemCompiler A.groovy{noformat}
results in
{noformat}
>>> a serious error occurred: BUG! exception in phase 'instruction selection' 
>>> in source unit 'A.groovy' Tried to overwrite existing meta data 
>>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
>>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
>>> property: ConstantExpression[fooNames]].
>>> stacktrace:
BUG! exception in phase 'instruction selection' in source unit 'A.groovy' Tried 
to overwrite existing meta data 
org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] property: 
ConstantExpression[fooNames]].
    at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
    at 
org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
    at 
org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
{noformat}
Oracle Java 8u181, Ubuntu 18.04.

*sigh*... wtf?

 


was (Author: patric42):
Just tried:
{noformat}
git pull; ./gradlew clean; gradlew installGroovy;
java -cp target/install/lib/groovy-2.5.3-SNAPSHOT.jar 
org.codehaus.groovy.tools.FileSystemCompiler A.groov{noformat}
results in
{noformat}
>>> a serious error occurred: BUG! exception in phase 'instruction selection' 
>>> in source unit 'A.groovy' Tried to overwrite existing meta data 
>>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
>>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
>>> property: ConstantExpression[fooNames]].
>>> stacktrace:
BUG! exception in phase 'instruction selection' in source unit 'A.groovy' Tried 
to overwrite existing meta data 
org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] property: 
ConstantExpression[fooNames]].
    at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
    at 
org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
    at 
org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
{noformat}
Oracle Java 8u181, Ubuntu 18.04.

*sigh*... wtf?

 

> Compiler error in STC: exception in phase 'instruction selection'
> -
>
> Key: GROOVY-8753
> 

[jira] [Commented] (GROOVY-8753) Compiler error in STC: exception in phase 'instruction selection'

2018-08-20 Thread Patric Bechtel (JIRA)


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

Patric Bechtel commented on GROOVY-8753:


Just tried:
{noformat}
git pull; ./gradlew clean; gradlew installGroovy;
java -cp target/install/lib/groovy-2.5.3-SNAPSHOT.jar 
org.codehaus.groovy.tools.FileSystemCompiler A.groov{noformat}
results in
{noformat}
>>> a serious error occurred: BUG! exception in phase 'instruction selection' 
>>> in source unit 'A.groovy' Tried to overwrite existing meta data 
>>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
>>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
>>> property: ConstantExpression[fooNames]].
>>> stacktrace:
BUG! exception in phase 'instruction selection' in source unit 'A.groovy' Tried 
to overwrite existing meta data 
org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] property: 
ConstantExpression[fooNames]].
    at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
    at 
org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
    at 
org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
{noformat}
Oracle Java 8u181, Ubuntu 18.04.

*sigh*... wtf?

 

> Compiler error in STC: exception in phase 'instruction selection'
> -
>
> Key: GROOVY-8753
> URL: https://issues.apache.org/jira/browse/GROOVY-8753
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.5.2
> Environment: Java 8u181, Ubuntu 18.04
>Reporter: Patric Bechtel
>Assignee: Paul King
>Priority: Critical
> Fix For: 3.0.0-alpha-4, 2.5.3
>
>
> Following source compiles under 2.5.1 and 3.0alpha3, but not 2.5.2:
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    private List fooNames = []
>    public A(Collection names) {
>   names.each { fooNames << it }
>    }
>    public List getFooNames() { fooNames }
> }
> {code}
> error message is:
> {noformat}
> >>> a serious error occurred: BUG! exception in phase 'instruction selection' 
> >>> in source unit 'A.groovy' Tried to overwrite existing meta data 
> >>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> >>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> >>> property: ConstantExpression[fooNames]].
> >>> stacktrace:
> BUG! exception in phase 'instruction selection' in source unit 'A.groovy' 
> Tried to overwrite existing meta data 
> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> property: ConstantExpression[fooNames]].
>     at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
>     at 
> org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
>    

[jira] [Commented] (GROOVY-8753) Compiler error in STC: exception in phase 'instruction selection'

2018-08-20 Thread Patric Bechtel (JIRA)


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

Patric Bechtel commented on GROOVY-8753:


Ack - the test in the pull request works.

The test on from the shell, via
{noformat}
java -cp groovy/target/libs/groovy-2.5.3-SNAPSHOT.jar 
org.codehaus.groovy.tools.FileSystemCompiler A.groovy{noformat}
doesn't.

> Compiler error in STC: exception in phase 'instruction selection'
> -
>
> Key: GROOVY-8753
> URL: https://issues.apache.org/jira/browse/GROOVY-8753
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.5.2
> Environment: Java 8u181, Ubuntu 18.04
>Reporter: Patric Bechtel
>Assignee: Paul King
>Priority: Critical
> Fix For: 3.0.0-alpha-4, 2.5.3
>
>
> Following source compiles under 2.5.1 and 3.0alpha3, but not 2.5.2:
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    private List fooNames = []
>    public A(Collection names) {
>   names.each { fooNames << it }
>    }
>    public List getFooNames() { fooNames }
> }
> {code}
> error message is:
> {noformat}
> >>> a serious error occurred: BUG! exception in phase 'instruction selection' 
> >>> in source unit 'A.groovy' Tried to overwrite existing meta data 
> >>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> >>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> >>> property: ConstantExpression[fooNames]].
> >>> stacktrace:
> BUG! exception in phase 'instruction selection' in source unit 'A.groovy' 
> Tried to overwrite existing meta data 
> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> property: ConstantExpression[fooNames]].
>     at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
>     at 
> org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
>     at 
> org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:785)
>     at 
> org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:122)
>     at 
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
>     at 
> org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:88)
>     at 
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBlockStatement(StaticTypeCheckingVisitor.java:3628)
>     at 
> org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitClosureExpression(CodeVisitorSupport.java:227)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClosureExpression(StaticTypeCheckingVisitor.java:2286)
>     at 
> org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:49)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallArguments(StaticTypeCheckingVisitor.java:2596)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallExpression(StaticTypeCheckingVisitor.java:3286)
>     at 
> org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethodCallExpression(StaticCompilationVisitor.java:397)
>     at 
> 

[jira] [Comment Edited] (GROOVY-8753) Compiler error in STC: exception in phase 'instruction selection'

2018-08-20 Thread Patric Bechtel (JIRA)


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

Patric Bechtel edited comment on GROOVY-8753 at 8/20/18 8:04 AM:
-

I should add something. While trying to reproduce the bug, the (ugly) line
{code:java}
names.each { fooNames << it }
{code}
is important. Replacing that line by the (much nicer)
{code:java}
fooNames.addAll( names )
{code}
it works.

That might give a clue where this comes from...


was (Author: patric42):
I should add something. While trying to reproduce the bug, the (ugly) line
{code:java}
names.each { fooNames << it }
{code}
is important. Replacing that line by the (much nicer) line
{code:java}
fooNames.addAll( names )
{code}
it works.

That might give a clue where this comes from...

> Compiler error in STC: exception in phase 'instruction selection'
> -
>
> Key: GROOVY-8753
> URL: https://issues.apache.org/jira/browse/GROOVY-8753
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.5.2
> Environment: Java 8u181, Ubuntu 18.04
>Reporter: Patric Bechtel
>Assignee: Paul King
>Priority: Critical
> Fix For: 3.0.0-alpha-4, 2.5.3
>
>
> Following source compiles under 2.5.1 and 3.0alpha3, but not 2.5.2:
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    private List fooNames = []
>    public A(Collection names) {
>   names.each { fooNames << it }
>    }
>    public List getFooNames() { fooNames }
> }
> {code}
> error message is:
> {noformat}
> >>> a serious error occurred: BUG! exception in phase 'instruction selection' 
> >>> in source unit 'A.groovy' Tried to overwrite existing meta data 
> >>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> >>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> >>> property: ConstantExpression[fooNames]].
> >>> stacktrace:
> BUG! exception in phase 'instruction selection' in source unit 'A.groovy' 
> Tried to overwrite existing meta data 
> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> property: ConstantExpression[fooNames]].
>     at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
>     at 
> org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
>     at 
> org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:785)
>     at 
> org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:122)
>     at 
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
>     at 
> org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:88)
>     at 
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBlockStatement(StaticTypeCheckingVisitor.java:3628)
>     at 
> org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitClosureExpression(CodeVisitorSupport.java:227)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClosureExpression(StaticTypeCheckingVisitor.java:2286)
>     at 
> org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:49)
>     at 
> 

[jira] [Commented] (GROOVY-8753) Compiler error in STC: exception in phase 'instruction selection'

2018-08-20 Thread Patric Bechtel (JIRA)


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

Patric Bechtel commented on GROOVY-8753:


I should add something. While trying to reproduce the bug, the (ugly) line
{code:java}
names.each { fooNames << it }
{code}
is important. Replacing that line by the (much nicer) line
{code:java}
fooNames.addAll( names )
{code}
it works.

That might give a clue where this comes from...

> Compiler error in STC: exception in phase 'instruction selection'
> -
>
> Key: GROOVY-8753
> URL: https://issues.apache.org/jira/browse/GROOVY-8753
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.5.2
> Environment: Java 8u181, Ubuntu 18.04
>Reporter: Patric Bechtel
>Assignee: Paul King
>Priority: Critical
> Fix For: 3.0.0-alpha-4, 2.5.3
>
>
> Following source compiles under 2.5.1 and 3.0alpha3, but not 2.5.2:
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    private List fooNames = []
>    public A(Collection names) {
>   names.each { fooNames << it }
>    }
>    public List getFooNames() { fooNames }
> }
> {code}
> error message is:
> {noformat}
> >>> a serious error occurred: BUG! exception in phase 'instruction selection' 
> >>> in source unit 'A.groovy' Tried to overwrite existing meta data 
> >>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> >>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> >>> property: ConstantExpression[fooNames]].
> >>> stacktrace:
> BUG! exception in phase 'instruction selection' in source unit 'A.groovy' 
> Tried to overwrite existing meta data 
> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> property: ConstantExpression[fooNames]].
>     at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
>     at 
> org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
>     at 
> org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:785)
>     at 
> org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:122)
>     at 
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
>     at 
> org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:88)
>     at 
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBlockStatement(StaticTypeCheckingVisitor.java:3628)
>     at 
> org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitClosureExpression(CodeVisitorSupport.java:227)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClosureExpression(StaticTypeCheckingVisitor.java:2286)
>     at 
> org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:49)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallArguments(StaticTypeCheckingVisitor.java:2596)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallExpression(StaticTypeCheckingVisitor.java:3286)
>     at 
> 

[jira] [Reopened] (GROOVY-8753) Compiler error in STC: exception in phase 'instruction selection'

2018-08-20 Thread Patric Bechtel (JIRA)


 [ 
https://issues.apache.org/jira/browse/GROOVY-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Patric Bechtel reopened GROOVY-8753:


I just verified with a build from bf37aa58f97b51081fba355c5ef4356d569af68a;

Still doesn't work, the error message is identical.

 

 

> Compiler error in STC: exception in phase 'instruction selection'
> -
>
> Key: GROOVY-8753
> URL: https://issues.apache.org/jira/browse/GROOVY-8753
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.5.2
> Environment: Java 8u181, Ubuntu 18.04
>Reporter: Patric Bechtel
>Assignee: Paul King
>Priority: Critical
> Fix For: 3.0.0-alpha-4, 2.5.3
>
>
> Following source compiles under 2.5.1 and 3.0alpha3, but not 2.5.2:
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    private List fooNames = []
>    public A(Collection names) {
>   names.each { fooNames << it }
>    }
>    public List getFooNames() { fooNames }
> }
> {code}
> error message is:
> {noformat}
> >>> a serious error occurred: BUG! exception in phase 'instruction selection' 
> >>> in source unit 'A.groovy' Tried to overwrite existing meta data 
> >>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> >>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> >>> property: ConstantExpression[fooNames]].
> >>> stacktrace:
> BUG! exception in phase 'instruction selection' in source unit 'A.groovy' 
> Tried to overwrite existing meta data 
> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
> property: ConstantExpression[fooNames]].
>     at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
>     at 
> org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
>     at 
> org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:785)
>     at 
> org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:122)
>     at 
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
>     at 
> org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:88)
>     at 
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBlockStatement(StaticTypeCheckingVisitor.java:3628)
>     at 
> org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
>     at 
> org.codehaus.groovy.ast.CodeVisitorSupport.visitClosureExpression(CodeVisitorSupport.java:227)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClosureExpression(StaticTypeCheckingVisitor.java:2286)
>     at 
> org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:49)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallArguments(StaticTypeCheckingVisitor.java:2596)
>     at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallExpression(StaticTypeCheckingVisitor.java:3286)
>     at 
> org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethodCallExpression(StaticCompilationVisitor.java:397)
>     at 
> org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
>     at 
> 

[jira] [Created] (GROOVY-8753) Compiler error in STC: exception in phase 'instruction selection'

2018-08-17 Thread Patric Bechtel (JIRA)
Patric Bechtel created GROOVY-8753:
--

 Summary: Compiler error in STC: exception in phase 'instruction 
selection'
 Key: GROOVY-8753
 URL: https://issues.apache.org/jira/browse/GROOVY-8753
 Project: Groovy
  Issue Type: Bug
  Components: Static compilation
Affects Versions: 2.5.2
 Environment: Java 8u181, Ubuntu 18.04
Reporter: Patric Bechtel


Following source compiles under 2.5.1 and 3.0alpha3, but not 2.5.2:
{code:java}
@groovy.transform.CompileStatic
class A {

   private List fooNames = []

   public A(Collection names) {
  names.each { fooNames << it }
   }

   public List getFooNames() { fooNames }

}
{code}
error message is:
{noformat}
>>> a serious error occurred: BUG! exception in phase 'instruction selection' 
>>> in source unit 'A.groovy' Tried to overwrite existing meta data 
>>> org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
>>> org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] 
>>> property: ConstantExpression[fooNames]].
>>> stacktrace:
BUG! exception in phase 'instruction selection' in source unit 'A.groovy' Tried 
to overwrite existing meta data 
org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: 
org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] property: 
ConstantExpression[fooNames]].
    at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
    at 
org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
    at 
org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:785)
    at 
org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
    at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:122)
    at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
    at 
org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
    at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:88)
    at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBlockStatement(StaticTypeCheckingVisitor.java:3628)
    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
    at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitClosureExpression(CodeVisitorSupport.java:227)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClosureExpression(StaticTypeCheckingVisitor.java:2286)
    at 
org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:49)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallArguments(StaticTypeCheckingVisitor.java:2596)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallExpression(StaticTypeCheckingVisitor.java:3286)
    at 
org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethodCallExpression(StaticCompilationVisitor.java:397)
    at 
org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
    at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:122)
    at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
    at 
org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
    at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:88)
    at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
    at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBlockStatement(StaticTypeCheckingVisitor.java:3628)
    at 

[jira] [Commented] (GROOVY-8737) STC Method resolution fails if other methods with more parameters exist

2018-08-10 Thread Patric Bechtel (JIRA)


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

Patric Bechtel commented on GROOVY-8737:


Why search for a longer parameter set if we find one which satisfies the call?

The easiest argument is to use CompileDynamic on B - it'll just work the way I 
expected it. It's just STC which doesn't.

> STC Method resolution fails if other methods with more parameters exist
> ---
>
> Key: GROOVY-8737
> URL: https://issues.apache.org/jira/browse/GROOVY-8737
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.15, 3.0.0-alpha-3, 2.5.1
> Environment: Ubuntu 18.04, Java 8u181
>Reporter: Patric Bechtel
>Priority: Major
>
> Given two classes as follows
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    public static String msg( String key, Object[] args ) { "key=$key, 
> args=$args" }
>    public static String msg( String key, Object[] args, Object[] parts ) { 
> "key=$key, args=$args, parts=$parts" }
>    public static String msg( String key, Object[] args, String[] names ) { 
> "key=$key, args=$args, names=$names" }
> }
> {code}
> and
> {code:java}
> @groovy.transform.CompileStatic
> public class B {
>    public static void main( String[] args ) {
>   println A.msg( 'hello', [ 'world' ] as Object[] )
>    }
> }
> {code}
> will not compile with the error
> {noformat}
> B.groovy: 4: [Static type checking] - Reference to method is ambiguous. 
> Cannot choose between [java.lang.String A#msg(java.lang.String, 
> java.lang.Object[], java.lang.Object[]), java.lang.String 
> A#msg(java.lang.String, java.lang.Object[], java.lang.String[])]
>  @ line 4, column 15.
>  println A.msg( 'hello', [ 'world' ] as Object[] )
> {noformat}
> Though there's a perfect match for the called method, it tries to choose one 
> of the longer signatures.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8737) STC Method resolution fails if other methods with more parameters exist

2018-08-09 Thread Patric Bechtel (JIRA)


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

Patric Bechtel commented on GROOVY-8737:


Couldn't we just stop trying vararg variants if we *have* a perfect match 
already?

> STC Method resolution fails if other methods with more parameters exist
> ---
>
> Key: GROOVY-8737
> URL: https://issues.apache.org/jira/browse/GROOVY-8737
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.15, 3.0.0-alpha-3, 2.5.1
> Environment: Ubuntu 18.04, Java 8u181
>Reporter: Patric Bechtel
>Priority: Major
>
> Given two classes as follows
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    public static String msg( String key, Object[] args ) { "key=$key, 
> args=$args" }
>    public static String msg( String key, Object[] args, Object[] parts ) { 
> "key=$key, args=$args, parts=$parts" }
>    public static String msg( String key, Object[] args, String[] names ) { 
> "key=$key, args=$args, names=$names" }
> }
> {code}
> and
> {code:java}
> @groovy.transform.CompileStatic
> public class B {
>    public static void main( String[] args ) {
>   println A.msg( 'hello', [ 'world' ] as Object[] )
>    }
> }
> {code}
> will not compile with the error
> {noformat}
> B.groovy: 4: [Static type checking] - Reference to method is ambiguous. 
> Cannot choose between [java.lang.String A#msg(java.lang.String, 
> java.lang.Object[], java.lang.Object[]), java.lang.String 
> A#msg(java.lang.String, java.lang.Object[], java.lang.String[])]
>  @ line 4, column 15.
>  println A.msg( 'hello', [ 'world' ] as Object[] )
> {noformat}
> Though there's a perfect match for the called method, it tries to choose one 
> of the longer signatures.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8737) STC Method resolution fails if other methods with more parameters exist

2018-08-09 Thread Patric Bechtel (JIRA)


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

Patric Bechtel commented on GROOVY-8737:


Yeah, ok ;)

 

But given the principle of least surprise, this is quite surprising.

I didn't know that anyone was using multiple varargs - wasn't it constrained to 
the last parameter?

> STC Method resolution fails if other methods with more parameters exist
> ---
>
> Key: GROOVY-8737
> URL: https://issues.apache.org/jira/browse/GROOVY-8737
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.15, 3.0.0-alpha-3, 2.5.1
> Environment: Ubuntu 18.04, Java 8u181
>Reporter: Patric Bechtel
>Priority: Major
>
> Given two classes as follows
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    public static String msg( String key, Object[] args ) { "key=$key, 
> args=$args" }
>    public static String msg( String key, Object[] args, Object[] parts ) { 
> "key=$key, args=$args, parts=$parts" }
>    public static String msg( String key, Object[] args, String[] names ) { 
> "key=$key, args=$args, names=$names" }
> }
> {code}
> and
> {code:java}
> @groovy.transform.CompileStatic
> public class B {
>    public static void main( String[] args ) {
>   println A.msg( 'hello', [ 'world' ] as Object[] )
>    }
> }
> {code}
> will not compile with the error
> {noformat}
> B.groovy: 4: [Static type checking] - Reference to method is ambiguous. 
> Cannot choose between [java.lang.String A#msg(java.lang.String, 
> java.lang.Object[], java.lang.Object[]), java.lang.String 
> A#msg(java.lang.String, java.lang.Object[], java.lang.String[])]
>  @ line 4, column 15.
>  println A.msg( 'hello', [ 'world' ] as Object[] )
> {noformat}
> Though there's a perfect match for the called method, it tries to choose one 
> of the longer signatures.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (GROOVY-8737) STC Method resolution fails if other methods with more parameters exist

2018-08-09 Thread Patric Bechtel (JIRA)


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

Patric Bechtel edited comment on GROOVY-8737 at 8/9/18 11:45 AM:
-

I always understood that (useful) feature as looking at the very last parameter 
and only if there's more parameters in the call than the method has.

This case is reverse IMHO: There's two parameters given, and groovy is trying 
to match more to put zero-sized arrays there. Which is weird.


was (Author: patric42):
I always understood that (useful) feature as looking at the very last parameter 
and only if there's more parameters in the call than to method has.

This case is reverse IMHO: There's two parameters given, and groovy is trying 
to match more to put zero-sized arrays there. Which is weird.

> STC Method resolution fails if other methods with more parameters exist
> ---
>
> Key: GROOVY-8737
> URL: https://issues.apache.org/jira/browse/GROOVY-8737
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.15, 3.0.0-alpha-3, 2.5.1
> Environment: Ubuntu 18.04, Java 8u181
>Reporter: Patric Bechtel
>Priority: Major
>
> Given two classes as follows
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    public static String msg( String key, Object[] args ) { "key=$key, 
> args=$args" }
>    public static String msg( String key, Object[] args, Object[] parts ) { 
> "key=$key, args=$args, parts=$parts" }
>    public static String msg( String key, Object[] args, String[] names ) { 
> "key=$key, args=$args, names=$names" }
> }
> {code}
> and
> {code:java}
> @groovy.transform.CompileStatic
> public class B {
>    public static void main( String[] args ) {
>   println A.msg( 'hello', [ 'world' ] as Object[] )
>    }
> }
> {code}
> will not compile with the error
> {noformat}
> B.groovy: 4: [Static type checking] - Reference to method is ambiguous. 
> Cannot choose between [java.lang.String A#msg(java.lang.String, 
> java.lang.Object[], java.lang.Object[]), java.lang.String 
> A#msg(java.lang.String, java.lang.Object[], java.lang.String[])]
>  @ line 4, column 15.
>  println A.msg( 'hello', [ 'world' ] as Object[] )
> {noformat}
> Though there's a perfect match for the called method, it tries to choose one 
> of the longer signatures.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (GROOVY-8737) STC Method resolution fails if other methods with more parameters exist

2018-08-09 Thread Patric Bechtel (JIRA)


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

Patric Bechtel edited comment on GROOVY-8737 at 8/9/18 11:45 AM:
-

I always understood that (useful) feature as looking at the very last parameter 
and only if there's more parameters in the call than to method has.

This case is reverse IMHO: There's two parameters given, and groovy is trying 
to match more to put zero-sized arrays there. Which is weird.


was (Author: patric42):
I always understood that (useful) feature as looking at the very last parameter 
and only if there's more parameters to match.

This case is reverse IMHO: There's two parameters given, and groovy is trying 
to match more to put zero-sized arrays there. Which is weird.

> STC Method resolution fails if other methods with more parameters exist
> ---
>
> Key: GROOVY-8737
> URL: https://issues.apache.org/jira/browse/GROOVY-8737
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.15, 3.0.0-alpha-3, 2.5.1
> Environment: Ubuntu 18.04, Java 8u181
>Reporter: Patric Bechtel
>Priority: Major
>
> Given two classes as follows
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    public static String msg( String key, Object[] args ) { "key=$key, 
> args=$args" }
>    public static String msg( String key, Object[] args, Object[] parts ) { 
> "key=$key, args=$args, parts=$parts" }
>    public static String msg( String key, Object[] args, String[] names ) { 
> "key=$key, args=$args, names=$names" }
> }
> {code}
> and
> {code:java}
> @groovy.transform.CompileStatic
> public class B {
>    public static void main( String[] args ) {
>   println A.msg( 'hello', [ 'world' ] as Object[] )
>    }
> }
> {code}
> will not compile with the error
> {noformat}
> B.groovy: 4: [Static type checking] - Reference to method is ambiguous. 
> Cannot choose between [java.lang.String A#msg(java.lang.String, 
> java.lang.Object[], java.lang.Object[]), java.lang.String 
> A#msg(java.lang.String, java.lang.Object[], java.lang.String[])]
>  @ line 4, column 15.
>  println A.msg( 'hello', [ 'world' ] as Object[] )
> {noformat}
> Though there's a perfect match for the called method, it tries to choose one 
> of the longer signatures.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8737) STC Method resolution fails if other methods with more parameters exist

2018-08-09 Thread Patric Bechtel (JIRA)


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

Patric Bechtel commented on GROOVY-8737:


I always understood that (useful) feature as looking at the very last parameter 
and only if there's more parameters to match.

This case is reverse IMHO: There's two parameters given, and groovy is trying 
to match more to put zero-sized arrays there. Which is weird.

> STC Method resolution fails if other methods with more parameters exist
> ---
>
> Key: GROOVY-8737
> URL: https://issues.apache.org/jira/browse/GROOVY-8737
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.15, 3.0.0-alpha-3, 2.5.1
> Environment: Ubuntu 18.04, Java 8u181
>Reporter: Patric Bechtel
>Priority: Major
>
> Given two classes as follows
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    public static String msg( String key, Object[] args ) { "key=$key, 
> args=$args" }
>    public static String msg( String key, Object[] args, Object[] parts ) { 
> "key=$key, args=$args, parts=$parts" }
>    public static String msg( String key, Object[] args, String[] names ) { 
> "key=$key, args=$args, names=$names" }
> }
> {code}
> and
> {code:java}
> @groovy.transform.CompileStatic
> public class B {
>    public static void main( String[] args ) {
>   println A.msg( 'hello', [ 'world' ] as Object[] )
>    }
> }
> {code}
> will not compile with the error
> {noformat}
> B.groovy: 4: [Static type checking] - Reference to method is ambiguous. 
> Cannot choose between [java.lang.String A#msg(java.lang.String, 
> java.lang.Object[], java.lang.Object[]), java.lang.String 
> A#msg(java.lang.String, java.lang.Object[], java.lang.String[])]
>  @ line 4, column 15.
>  println A.msg( 'hello', [ 'world' ] as Object[] )
> {noformat}
> Though there's a perfect match for the called method, it tries to choose one 
> of the longer signatures.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (GROOVY-8737) STC Method resolution fails if other methods with more parameters exist

2018-08-09 Thread Patric Bechtel (JIRA)


 [ 
https://issues.apache.org/jira/browse/GROOVY-8737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Patric Bechtel updated GROOVY-8737:
---
Description: 
Given two classes as follows
{code:java}
@groovy.transform.CompileStatic
class A {
   public static String msg( String key, Object[] args ) { "key=$key, 
args=$args" }
   public static String msg( String key, Object[] args, Object[] parts ) { 
"key=$key, args=$args, parts=$parts" }
   public static String msg( String key, Object[] args, String[] names ) { 
"key=$key, args=$args, names=$names" }
}
{code}
and
{code:java}
@groovy.transform.CompileStatic
public class B {
   public static void main( String[] args ) {
  println A.msg( 'hello', [ 'world' ] as Object[] )
   }
}
{code}
will not compile with the error
{noformat}
B.groovy: 4: [Static type checking] - Reference to method is ambiguous. Cannot 
choose between [java.lang.String A#msg(java.lang.String, java.lang.Object[], 
java.lang.Object[]), java.lang.String A#msg(java.lang.String, 
java.lang.Object[], java.lang.String[])]
 @ line 4, column 15.
 println A.msg( 'hello', [ 'world' ] as Object[] )
{noformat}
Though there's a perfect match for the called method, it tries to choose one of 
the longer signatures.

  was:
Given two classes as follows

 
{code:java}
@groovy.transform.CompileStatic
class A {
   public static String msg( String key, Object[] args ) { "key=$key, 
args=$args" }
   public static String msg( String key, Object[] args, Object[] parts ) { 
"key=$key, args=$args, parts=$parts" }
   public static String msg( String key, Object[] args, String[] names ) { 
"key=$key, args=$args, names=$names" }
}
{code}
and

 
{code:java}
@groovy.transform.CompileStatic
public class B {
   public static void main( String[] args ) {
  println A.msg( 'hello', [ 'world' ] as Object[] )
   }
}
{code}
will not compile with the error
{noformat}
B.groovy: 4: [Static type checking] - Reference to method is ambiguous. Cannot 
choose between [java.lang.String A#msg(java.lang.String, java.lang.Object[], 
java.lang.Object[]), java.lang.String A#msg(java.lang.String, 
java.lang.Object[], java.lang.String[])]
 @ line 4, column 15.
 println A.msg( 'hello', [ 'world' ] as Object[] )
{noformat}
Though there's a perfect match for the called method, it tries to choose one of 
the longer signatures.

 


> STC Method resolution fails if other methods with more parameters exist
> ---
>
> Key: GROOVY-8737
> URL: https://issues.apache.org/jira/browse/GROOVY-8737
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.15, 3.0.0-alpha-3, 2.5.1
> Environment: Ubuntu 18.04, Java 8u181
>Reporter: Patric Bechtel
>Priority: Major
>
> Given two classes as follows
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>    public static String msg( String key, Object[] args ) { "key=$key, 
> args=$args" }
>    public static String msg( String key, Object[] args, Object[] parts ) { 
> "key=$key, args=$args, parts=$parts" }
>    public static String msg( String key, Object[] args, String[] names ) { 
> "key=$key, args=$args, names=$names" }
> }
> {code}
> and
> {code:java}
> @groovy.transform.CompileStatic
> public class B {
>    public static void main( String[] args ) {
>   println A.msg( 'hello', [ 'world' ] as Object[] )
>    }
> }
> {code}
> will not compile with the error
> {noformat}
> B.groovy: 4: [Static type checking] - Reference to method is ambiguous. 
> Cannot choose between [java.lang.String A#msg(java.lang.String, 
> java.lang.Object[], java.lang.Object[]), java.lang.String 
> A#msg(java.lang.String, java.lang.Object[], java.lang.String[])]
>  @ line 4, column 15.
>  println A.msg( 'hello', [ 'world' ] as Object[] )
> {noformat}
> Though there's a perfect match for the called method, it tries to choose one 
> of the longer signatures.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (GROOVY-8737) STC Method resolution fails if other methods with more parameters exist

2018-08-09 Thread Patric Bechtel (JIRA)
Patric Bechtel created GROOVY-8737:
--

 Summary: STC Method resolution fails if other methods with more 
parameters exist
 Key: GROOVY-8737
 URL: https://issues.apache.org/jira/browse/GROOVY-8737
 Project: Groovy
  Issue Type: Bug
  Components: Static compilation
Affects Versions: 2.5.1, 3.0.0-alpha-3, 2.4.15
 Environment: Ubuntu 18.04, Java 8u181
Reporter: Patric Bechtel


Given two classes as follows

 
{code:java}
@groovy.transform.CompileStatic
class A {
   public static String msg( String key, Object[] args ) { "key=$key, 
args=$args" }
   public static String msg( String key, Object[] args, Object[] parts ) { 
"key=$key, args=$args, parts=$parts" }
   public static String msg( String key, Object[] args, String[] names ) { 
"key=$key, args=$args, names=$names" }
}
{code}
and

 
{code:java}
@groovy.transform.CompileStatic
public class B {
   public static void main( String[] args ) {
  println A.msg( 'hello', [ 'world' ] as Object[] )
   }
}
{code}
will not compile with the error
{noformat}
B.groovy: 4: [Static type checking] - Reference to method is ambiguous. Cannot 
choose between [java.lang.String A#msg(java.lang.String, java.lang.Object[], 
java.lang.Object[]), java.lang.String A#msg(java.lang.String, 
java.lang.Object[], java.lang.String[])]
 @ line 4, column 15.
 println A.msg( 'hello', [ 'world' ] as Object[] )
{noformat}
Though there's a perfect match for the called method, it tries to choose one of 
the longer signatures.

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8384) Regression in 2.4.13 (snapshot) with STC and intdiv

2017-11-19 Thread Patric Bechtel (JIRA)

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

Patric Bechtel commented on GROOVY-8384:


Thank you :D

> Regression in 2.4.13 (snapshot) with STC and intdiv
> ---
>
> Key: GROOVY-8384
> URL: https://issues.apache.org/jira/browse/GROOVY-8384
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.13
> Environment: any
>Reporter: Patric Bechtel
>Assignee: Paul King
> Fix For: 2.4.13
>
>
> Even with the fix of 8380, the following still fails:
> {code}
> @groovy.transform.CompileStatic
> class GanzBla {
>static void main(String[] args) {
>   def a = 5.intdiv(2)
>   assert a.class == java.lang.Integer
>   def b = new Long( 5.intdiv(2) )
>}
> }
> {code}
> Without CS, this just works, the type of 5.intdiv(2) is an Integer. With STC, 
> it's a number suddenly. In 2.4.12, this still works flawlessly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GROOVY-8384) Regression in 2.4.13 (snapshot) with STC and intdiv

2017-11-17 Thread Patric Bechtel (JIRA)
Patric Bechtel created GROOVY-8384:
--

 Summary: Regression in 2.4.13 (snapshot) with STC and intdiv
 Key: GROOVY-8384
 URL: https://issues.apache.org/jira/browse/GROOVY-8384
 Project: Groovy
  Issue Type: Bug
  Components: Static compilation
Affects Versions: 2.4.13
 Environment: any
Reporter: Patric Bechtel


Even with the fix of 8380, the following still fails:
{code}
@groovy.transform.CompileStatic
class GanzBla {
   static void main(String[] args) {
  def a = 5.intdiv(2)
  assert a.class == java.lang.Integer
  def b = new Long( 5.intdiv(2) )
   }
}
{code}

Without CS, this just works, the type of 5.intdiv(2) is an Integer. With STC, 
it's a number suddenly. In 2.4.12, this still works flawlessly.




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8380) Regression in 2.4.13 (snapshot) 62615249161b233b1827d5950671d3a83007cd9f

2017-11-14 Thread Patric Bechtel (JIRA)

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

Patric Bechtel commented on GROOVY-8380:


How about {code}new Integer( 3 & (-1 ^ 3) ){code}?



> Regression in 2.4.13 (snapshot) 62615249161b233b1827d5950671d3a83007cd9f
> 
>
> Key: GROOVY-8380
> URL: https://issues.apache.org/jira/browse/GROOVY-8380
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.13
> Environment: any
>Reporter: Patric Bechtel
>Priority: Critical
>
> This used to work up to 2.4.12:
> {code}
> @groovy.transform.CompileStatic
> class bla {
>static void main(String[] args) {
>   println new Long( 5 / 3 )
>}
> }
> {code}
> starting with 2.4.13, it gives this error message:
> {noformat}
> bla.groovy: 4: [Static type checking] - Cannot find matching method 
> java.lang.Long#(java.math.BigDecimal). Please check if the declared 
> type is right and if the method exists.
>  @ line 4, column 15.
>  println new Long( 5 / 3 )
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8325) @CompileStatic calls wrong newInstance method.

2017-11-14 Thread Patric Bechtel (JIRA)

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

Patric Bechtel commented on GROOVY-8325:


Please have a look at GROOVY-8380, as this fix causes a regression for

@groovy.transform.CompileStatic
def bla() {
   new Long( 5 / 2 )
}

That used to work and seems on par with the Java behaviour on that matter.

> @CompileStatic calls wrong newInstance method.
> --
>
> Key: GROOVY-8325
> URL: https://issues.apache.org/jira/browse/GROOVY-8325
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler, Static compilation
>Affects Versions: 2.4.10
>Reporter: Xiaoguang WANG
>Assignee: Paul King
>Priority: Critical
> Fix For: 2.4.13
>
>
> {code:java}
> import groovy.transform.CompileStatic
> class Foo {
> static Foo newInstance(Long v) {
> return new Foo()
> }
> }
> @CompileStatic   //crash only caused by this CompileStatic
> class TestGroovy {
> static void main(String ... args) {
> def a = Foo.newInstance(123)  //when @CompileStatic, this calls 
> DefaultGroovyMethods.newInstance
> println a
> }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-8380) Regression in 2.4.13 (snapshot) 62615249161b233b1827d5950671d3a83007cd9f

2017-11-14 Thread Patric Bechtel (JIRA)

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

Patric Bechtel commented on GROOVY-8380:


The reason seems to be the fix for GROOVY-8325.

> Regression in 2.4.13 (snapshot) 62615249161b233b1827d5950671d3a83007cd9f
> 
>
> Key: GROOVY-8380
> URL: https://issues.apache.org/jira/browse/GROOVY-8380
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.13
> Environment: any
>Reporter: Patric Bechtel
>Priority: Critical
>
> This used to work up to 2.4.12:
> @groovy.transform.CompileStatic
> class bla {
>static void main(String[] args) {
>   println new Long( 5 / 3 )
>}
> }
> starting with 2.4.13, it gives this error message:
> bla.groovy: 4: [Static type checking] - Cannot find matching method 
> java.lang.Long#(java.math.BigDecimal). Please check if the declared 
> type is right and if the method exists.
>  @ line 4, column 15.
>  println new Long( 5 / 3 )



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GROOVY-8380) Regression in 2.4.13 (snapshot) 62615249161b233b1827d5950671d3a83007cd9f

2017-11-14 Thread Patric Bechtel (JIRA)
Patric Bechtel created GROOVY-8380:
--

 Summary: Regression in 2.4.13 (snapshot) 
62615249161b233b1827d5950671d3a83007cd9f
 Key: GROOVY-8380
 URL: https://issues.apache.org/jira/browse/GROOVY-8380
 Project: Groovy
  Issue Type: Bug
  Components: Static compilation
Affects Versions: 2.4.13
 Environment: any
Reporter: Patric Bechtel
Priority: Critical


This used to work up to 2.4.12:

@groovy.transform.CompileStatic
class bla {
   static void main(String[] args) {
  println new Long( 5 / 3 )
   }
}

starting with 2.4.13, it gives this error message:

bla.groovy: 4: [Static type checking] - Cannot find matching method 
java.lang.Long#(java.math.BigDecimal). Please check if the declared type 
is right and if the method exists.
 @ line 4, column 15.
 println new Long( 5 / 3 )





--
This message was sent by Atlassian JIRA
(v6.4.14#64029)