[jira] [Resolved] (GROOVY-7702) @CompileStatic and the method with(Closure) seem to determine wrong type
[ https://issues.apache.org/jira/browse/GROOVY-7702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Shil Sinha resolved GROOVY-7702. Resolution: Fixed Assignee: Shil Sinha Fix Version/s: 2.4.6 > @CompileStatic and the method with(Closure) seem to determine wrong type > > > Key: GROOVY-7702 > URL: https://issues.apache.org/jira/browse/GROOVY-7702 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.4.4, 2.4.5 >Reporter: Teerapong Suksuwan >Assignee: Shil Sinha >Priority: Minor > Fix For: 2.4.6 > > > In the code below. When refer to time without the "it" prefix. The compiler > get type of "time" wrongly. "time" is Date but it determined as long. > {code} > @CompileStatic > class GMain { > static void main(String[] args) { > Calendar.instance.with { > println time.class//This print java.util.Date which is OK > Date d1 = time//This line failed to compile with error Groovyc: > [Static type checking] - Cannot assign value of type long to variable of type > java.util.Date > Date d2 = it.time//This line is OK > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Resolved] (GROOVY-7036) An interface implementation (override) with a method including a default parameter value does not compile
[ https://issues.apache.org/jira/browse/GROOVY-7036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Shil Sinha resolved GROOVY-7036. Resolution: Fixed Assignee: Shil Sinha Fix Version/s: 2.4.6 > An interface implementation (override) with a method including a default > parameter value does not compile > - > > Key: GROOVY-7036 > URL: https://issues.apache.org/jira/browse/GROOVY-7036 > Project: Groovy > Issue Type: Bug > Components: Compiler >Affects Versions: 2.3.6 > Environment: JDK 1.7.0_60 >Reporter: Martin Ahrer >Assignee: Shil Sinha > Fix For: 2.4.6 > > > A complete (gradle based) project to demonstrate the problem has been > provided at https://github.com/MartinAhrer/bug-groovy-2.3-override. > {code} > interface TemplatedInterface { > T execute(Map argument) > } > class TemplatedInterfaceImplementation implements TemplatedInterface{ > // This won't compile with groovy 2.3.x when adding a default argument > value > @Override > String execute(Map argument = [:]) { > return null > } > } > {code} > This kind of relates to GROOVY-6654. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GROOVY-7702) @CompileStatic and the method with(Closure) seem to determine wrong type
[ https://issues.apache.org/jira/browse/GROOVY-7702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15073992#comment-15073992 ] ASF GitHub Bot commented on GROOVY-7702: Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/227 > @CompileStatic and the method with(Closure) seem to determine wrong type > > > Key: GROOVY-7702 > URL: https://issues.apache.org/jira/browse/GROOVY-7702 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.4.4, 2.4.5 >Reporter: Teerapong Suksuwan >Priority: Minor > > In the code below. When refer to time without the "it" prefix. The compiler > get type of "time" wrongly. "time" is Date but it determined as long. > {code} > @CompileStatic > class GMain { > static void main(String[] args) { > Calendar.instance.with { > println time.class//This print java.util.Date which is OK > Date d1 = time//This line failed to compile with error Groovyc: > [Static type checking] - Cannot assign value of type long to variable of type > java.util.Date > Date d2 = it.time//This line is OK > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GROOVY-7036) An interface implementation (override) with a method including a default parameter value does not compile
[ https://issues.apache.org/jira/browse/GROOVY-7036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15073941#comment-15073941 ] ASF GitHub Bot commented on GROOVY-7036: Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/228 > An interface implementation (override) with a method including a default > parameter value does not compile > - > > Key: GROOVY-7036 > URL: https://issues.apache.org/jira/browse/GROOVY-7036 > Project: Groovy > Issue Type: Bug > Components: Compiler >Affects Versions: 2.3.6 > Environment: JDK 1.7.0_60 >Reporter: Martin Ahrer > > A complete (gradle based) project to demonstrate the problem has been > provided at https://github.com/MartinAhrer/bug-groovy-2.3-override. > {code} > interface TemplatedInterface { > T execute(Map argument) > } > class TemplatedInterfaceImplementation implements TemplatedInterface{ > // This won't compile with groovy 2.3.x when adding a default argument > value > @Override > String execute(Map argument = [:]) { > return null > } > } > {code} > This kind of relates to GROOVY-6654. -- This message was sent by Atlassian JIRA (v6.3.4#6332)