[jira] [Resolved] (GROOVY-3278) Using referenced String constant as value of Annotation causes compile error

2018-10-22 Thread Paul King (JIRA)


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

Paul King resolved GROOVY-3278.
---
Resolution: Fixed

I am going to mark this as resolved. The proposed PR modifies the AsmDecompiler 
to collect the required information. That is the default but the fix won't work 
if you disable "asmResolving".

> Using referenced String constant as value of Annotation causes compile error
> 
>
> Key: GROOVY-3278
> URL: https://issues.apache.org/jira/browse/GROOVY-3278
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 1.6-rc-1
> Environment: OSX 10.5.6
> JDK 1.6
>Reporter: Gregg Bolinger
>Assignee: Paul King
>Priority: Major
> Fix For: 3.0.0-alpha-4, 2.5.4
>
> Attachments: groovy2827_qualified_annotation_constants.patch, src.zip
>
>
> When using a String constant as the value for an annotation groovyc errors 
> out with the following message:
> Attribute 'value' should have type java.lang.String but found type 
> java.lang.Object in @SpringBean
> I've attached sample code to reproduce.  The annotation and PersonDao are 
> regular Java classes, just as was my case when finding the bug.   The 
> PersonAction is a Groovy class.



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


[jira] [Assigned] (GROOVY-3278) Using referenced String constant as value of Annotation causes compile error

2018-10-22 Thread Paul King (JIRA)


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

Paul King reassigned GROOVY-3278:
-

Assignee: Paul King

> Using referenced String constant as value of Annotation causes compile error
> 
>
> Key: GROOVY-3278
> URL: https://issues.apache.org/jira/browse/GROOVY-3278
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 1.6-rc-1
> Environment: OSX 10.5.6
> JDK 1.6
>Reporter: Gregg Bolinger
>Assignee: Paul King
>Priority: Major
> Fix For: 3.0.0-alpha-4, 2.5.4
>
> Attachments: groovy2827_qualified_annotation_constants.patch, src.zip
>
>
> When using a String constant as the value for an annotation groovyc errors 
> out with the following message:
> Attribute 'value' should have type java.lang.String but found type 
> java.lang.Object in @SpringBean
> I've attached sample code to reproduce.  The annotation and PersonDao are 
> regular Java classes, just as was my case when finding the bug.   The 
> PersonAction is a Groovy class.



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


[jira] [Updated] (GROOVY-3278) Using referenced String constant as value of Annotation causes compile error

2018-10-22 Thread Paul King (JIRA)


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

Paul King updated GROOVY-3278:
--
Fix Version/s: (was: 3.x)
   2.5.4
   3.0.0-alpha-4

> Using referenced String constant as value of Annotation causes compile error
> 
>
> Key: GROOVY-3278
> URL: https://issues.apache.org/jira/browse/GROOVY-3278
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 1.6-rc-1
> Environment: OSX 10.5.6
> JDK 1.6
>Reporter: Gregg Bolinger
>Priority: Major
> Fix For: 3.0.0-alpha-4, 2.5.4
>
> Attachments: groovy2827_qualified_annotation_constants.patch, src.zip
>
>
> When using a String constant as the value for an annotation groovyc errors 
> out with the following message:
> Attribute 'value' should have type java.lang.String but found type 
> java.lang.Object in @SpringBean
> I've attached sample code to reproduce.  The annotation and PersonDao are 
> regular Java classes, just as was my case when finding the bug.   The 
> PersonAction is a Groovy class.



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


[GitHub] groovy pull request #814: GROOVY-3278: Using referenced String constant as v...

2018-10-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/groovy/pull/814


---


[jira] [Commented] (GROOVY-3278) Using referenced String constant as value of Annotation causes compile error

2018-10-22 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on GROOVY-3278:


Github user asfgit closed the pull request at:

https://github.com/apache/groovy/pull/814


> Using referenced String constant as value of Annotation causes compile error
> 
>
> Key: GROOVY-3278
> URL: https://issues.apache.org/jira/browse/GROOVY-3278
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 1.6-rc-1
> Environment: OSX 10.5.6
> JDK 1.6
>Reporter: Gregg Bolinger
>Priority: Major
> Fix For: 3.x
>
> Attachments: groovy2827_qualified_annotation_constants.patch, src.zip
>
>
> When using a String constant as the value for an annotation groovyc errors 
> out with the following message:
> Attribute 'value' should have type java.lang.String but found type 
> java.lang.Object in @SpringBean
> I've attached sample code to reproduce.  The annotation and PersonDao are 
> regular Java classes, just as was my case when finding the bug.   The 
> PersonAction is a Groovy class.



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


[jira] [Commented] (GROOVY-8820) Closure inside trait cannot use Closure's delegate variables

2018-10-22 Thread JIRA


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

Frederico Costa Galvão commented on GROOVY-8820:


Can be reproduced with as little code as:

 
{code:groovy}
trait Bacon {
def what() {
String[] l = []
l.with {
length
}
}
}

class B implements Bacon {}

new B().what()
{code}

Changing `trait` with `class` and `implements` with `extends` makes the code 
run properly.

 

 

 

> Closure inside trait cannot use Closure's delegate variables
> 
>
> Key: GROOVY-8820
> URL: https://issues.apache.org/jira/browse/GROOVY-8820
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.4.15, 3.0.0-alpha-3, 2.5.2
> Environment: Groovy Version: 3.0.0-alpha-3 JVM: 1.8.0_171 Vendor: 
> Oracle Corporation OS: Mac OS X
>Reporter: Renato Athaydes
>Priority: Major
>
> The following code throws an error at runtime:
>  
> {code:java}
> trait T {
>     def doIt() {
>     return {
>     n = 1
>     }
>     }
> }
> class Delegate {
>     int n
> }
>     
> class Tish implements T {
>     def go() {
>     def closure = doIt()
>     def d = new Delegate()
>     closure.delegate = d
>     closure()
>     assert d.n == 1
>     println "All good!"
>     }
> }
> new Tish().go(){code}
>  
> This is the error I see on Groovy 3.0.0-alpha-3 (same as previous versions):
>  
> {code:java}
> groovy.lang.MissingPropertyException: No such property: n for class: 
> Tish{code}
>  
> This is expected to work because, outside of traits, it does: this runs 
> successfully:
>  
> {code:java}
> class T {
>     def doIt() {
>     return {
>     n = 1
>     }
>     }
> }
> class Delegate {
>     int n
> }
>     
> class Tisha extends T {
>     def go() {
>     def closure = doIt()
>     def d = new Delegate()
>     closure.delegate = d
>     closure()
>     assert d.n == 1
>     println "All good!"
>     }
> }
> new Tisha().go(){code}
>  



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


[jira] [Commented] (GROOVY-3278) Using referenced String constant as value of Annotation causes compile error

2018-10-22 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on GROOVY-3278:


GitHub user paulk-asert opened a pull request:

https://github.com/apache/groovy/pull/814

GROOVY-3278: Using referenced String constant as value of Annotation …

…causes compile error

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/paulk-asert/groovy groovy3278

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/814.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #814






> Using referenced String constant as value of Annotation causes compile error
> 
>
> Key: GROOVY-3278
> URL: https://issues.apache.org/jira/browse/GROOVY-3278
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 1.6-rc-1
> Environment: OSX 10.5.6
> JDK 1.6
>Reporter: Gregg Bolinger
>Priority: Major
> Fix For: 3.x
>
> Attachments: groovy2827_qualified_annotation_constants.patch, src.zip
>
>
> When using a String constant as the value for an annotation groovyc errors 
> out with the following message:
> Attribute 'value' should have type java.lang.String but found type 
> java.lang.Object in @SpringBean
> I've attached sample code to reproduce.  The annotation and PersonDao are 
> regular Java classes, just as was my case when finding the bug.   The 
> PersonAction is a Groovy class.



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


[GitHub] groovy pull request #814: GROOVY-3278: Using referenced String constant as v...

2018-10-22 Thread paulk-asert
GitHub user paulk-asert opened a pull request:

https://github.com/apache/groovy/pull/814

GROOVY-3278: Using referenced String constant as value of Annotation …

…causes compile error

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/paulk-asert/groovy groovy3278

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/814.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #814






---