[jira] [Resolved] (GROOVY-5453) Incorrect resolve of category property for String

2021-06-03 Thread Eric Milles (Jira)


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

Eric Milles resolved GROOVY-5453.
-
Fix Version/s: 4.0.0-beta-1
   Resolution: Fixed

> Incorrect resolve of category property for String
> -
>
> Key: GROOVY-5453
> URL: https://issues.apache.org/jira/browse/GROOVY-5453
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.4.0-rc-1
>Reporter: Maxim Medvedev
>Assignee: Eric Milles
>Priority: Major
> Fix For: 4.0.0-beta-1
>
>
> Assume you have two category methods with String and CharSequence as first 
> parameters respectively. The bug is that Groovy prefers the 'CharSequence' 
> method for String qualifier. 
> The bug is reproduced only for String and CharSequence types.
> Direct accessor invoking returns correct result.
> {code}
> class Cat {
>   static getFoo(String s) {'String'}
>   static getFoo(CharSequence s) {'CharSequence'}
> }
> use (Cat) {
>   assert 'abc'.getFoo() == 'String'   //works
>   assert 'abc'.foo  == 'String'   //fails
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Assigned] (GROOVY-5453) Incorrect resolve of category property for String

2021-06-03 Thread Eric Milles (Jira)


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

Eric Milles reassigned GROOVY-5453:
---

Assignee: Eric Milles

> Incorrect resolve of category property for String
> -
>
> Key: GROOVY-5453
> URL: https://issues.apache.org/jira/browse/GROOVY-5453
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.4.0-rc-1
>Reporter: Maxim Medvedev
>Assignee: Eric Milles
>Priority: Major
>
> Assume you have two category methods with String and CharSequence as first 
> parameters respectively. The bug is that Groovy prefers the 'CharSequence' 
> method for String qualifier. 
> The bug is reproduced only for String and CharSequence types.
> Direct accessor invoking returns correct result.
> {code}
> class Cat {
>   static getFoo(String s) {'String'}
>   static getFoo(CharSequence s) {'CharSequence'}
> }
> use (Cat) {
>   assert 'abc'.getFoo() == 'String'   //works
>   assert 'abc'.foo  == 'String'   //fails
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GROOVY-5453) Incorrect resolve of category property for String

2021-06-03 Thread Eric Milles (Jira)


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

Eric Milles commented on GROOVY-5453:
-

{{groovy.lang.MetaClassImpl#getCategoryMethodGetter}} and 
{{groovy.lang.MetaClassImpl#getCategoryMethodSetter}} are where the selection 
is made.

> Incorrect resolve of category property for String
> -
>
> Key: GROOVY-5453
> URL: https://issues.apache.org/jira/browse/GROOVY-5453
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.4.0-rc-1
>Reporter: Maxim Medvedev
>Priority: Major
>
> Assume you have two category methods with String and CharSequence as first 
> parameters respectively. The bug is that Groovy prefers the 'CharSequence' 
> method for String qualifier. 
> The bug is reproduced only for String and CharSequence types.
> Direct accessor invoking returns correct result.
> {code}
> class Cat {
>   static getFoo(String s) {'String'}
>   static getFoo(CharSequence s) {'CharSequence'}
> }
> use (Cat) {
>   assert 'abc'.getFoo() == 'String'   //works
>   assert 'abc'.foo  == 'String'   //fails
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GROOVY-10122) Wrong cast in stubs generated

2021-06-03 Thread Eric Milles (Jira)


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

Eric Milles commented on GROOVY-10122:
--

Yes, the fix for ambiguous special constructor call (GROOVY-9777) added Object 
cast.  This caused problems for path where type of constructor call argument 
cannot be determined easily.  This fix will be added to Groovy 3 branch before 
3.0.9 is released.

> Wrong cast in stubs generated
> -
>
> Key: GROOVY-10122
> URL: https://issues.apache.org/jira/browse/GROOVY-10122
> Project: Groovy
>  Issue Type: Bug
>  Components: Stub generator / Joint compiler
>Affects Versions: 3.0.8
>Reporter: Daniil Ovchinnikov
>Assignee: Eric Milles
>Priority: Major
> Fix For: 4.0.0-beta-1
>
> Attachments: mre.zip
>
>
> {noformat}
> $ #unzip
> $ cd mre/src
> $ groovy -version
> Groovy Version: 3.0.8 JVM: 15.0.1 Vendor: Oracle Corporation OS: Mac OS X
> $ groovyc -j JavaBase.java GroovyInheritor.groovy JavaUsage.java
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> Compile error during compilation with javac.
> /var/folders/t7/26sb5vb111n3ljbmwv4s340mgn/T/groovy-generated--java-source12536140884342736527/GroovyInheritor.java:14:
>  error: incompatible types: Object cannot be converted to Integer
> super((java.lang.Object)null);
>   ^
> Note: Some messages have been simplified; recompile with -Xdiags:verbose to 
> get full output
> 1 error
> 1 error
> {noformat}
> The issue is not reproducible in 3.0.7.
> Same issue can be reproduced opening the directory in IntelliJ and invoking 
> Rebuild Project. 
> Related https://youtrack.jetbrains.com/issue/IDEA-270650



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GROOVY-10122) Wrong cast in stubs generated

2021-06-03 Thread Daniil Ovchinnikov (Jira)


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

Daniil Ovchinnikov commented on GROOVY-10122:
-

There was no such issue in 3.0.7. Did you manage to find the cause? Can you 
port the fix to the 3.0.x branch? 

> Wrong cast in stubs generated
> -
>
> Key: GROOVY-10122
> URL: https://issues.apache.org/jira/browse/GROOVY-10122
> Project: Groovy
>  Issue Type: Bug
>  Components: Stub generator / Joint compiler
>Affects Versions: 3.0.8
>Reporter: Daniil Ovchinnikov
>Assignee: Eric Milles
>Priority: Major
> Fix For: 4.0.0-beta-1
>
> Attachments: mre.zip
>
>
> {noformat}
> $ #unzip
> $ cd mre/src
> $ groovy -version
> Groovy Version: 3.0.8 JVM: 15.0.1 Vendor: Oracle Corporation OS: Mac OS X
> $ groovyc -j JavaBase.java GroovyInheritor.groovy JavaUsage.java
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> Compile error during compilation with javac.
> /var/folders/t7/26sb5vb111n3ljbmwv4s340mgn/T/groovy-generated--java-source12536140884342736527/GroovyInheritor.java:14:
>  error: incompatible types: Object cannot be converted to Integer
> super((java.lang.Object)null);
>   ^
> Note: Some messages have been simplified; recompile with -Xdiags:verbose to 
> get full output
> 1 error
> 1 error
> {noformat}
> The issue is not reproducible in 3.0.7.
> Same issue can be reproduced opening the directory in IntelliJ and invoking 
> Rebuild Project. 
> Related https://youtrack.jetbrains.com/issue/IDEA-270650



--
This message was sent by Atlassian Jira
(v8.3.4#803005)