[jira] [Created] (GROOVY-8022) Plus assignment for unusual property

2016-12-14 Thread Daniil Ovchinnikov (JIRA)
Daniil Ovchinnikov created GROOVY-8022:
--

 Summary: Plus assignment for unusual property
 Key: GROOVY-8022
 URL: https://issues.apache.org/jira/browse/GROOVY-8022
 Project: Groovy
  Issue Type: Bug
  Components: Static Type Checker
Affects Versions: 2.4.7
Reporter: Daniil Ovchinnikov


{code}
class A {
C plus(B b) {
println "plus"
new C()
}
}

class B {}

class C {}

class Foo {
A getProp() {
println "get"
new A()
}

void setProp(C c) {
println "set"
}
}

@CompileStatic
class Main {
static void main(String[] args) {
def foo = new Foo()
foo.prop += new B()
}
}
{code}

Correctly prints without @CompileStatic:
{noformat}
get
plus
set
{noformat}

With @CompileStatic fails with:
{noformat}
Error:(32, 9) Groovyc: 
[Static type checking] - Cannot assign value of type B to variable of type C
{noformat}



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


[jira] [Commented] (GROOVY-8021) Super in traits causes MissingMethodException

2016-12-14 Thread Daniil Ovchinnikov (JIRA)

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

Daniil Ovchinnikov commented on GROOVY-8021:


Possible solutions:
- prohibit {{super}} within {{@CompileStatic}} traits since there is no way now 
to determine the superclass in compile time. 
- fail at least on static compilation of class which implements a trait 
referencing {{super}}, i.e. {{Foo}} 

One more question arises, why I get {{MissingMethodException}} from statically 
compiled code?


> Super in traits causes MissingMethodException
> -
>
> Key: GROOVY-8021
> URL: https://issues.apache.org/jira/browse/GROOVY-8021
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 2.4.7
>Reporter: Daniil Ovchinnikov
>
> {code}
> @CompileStatic
> trait SimpleTrait {
> void foo() {
> super.foo()
> }
> }
> @CompileStatic
> class Foo implements SimpleTrait {}
> new Foo().foo() // MissingMethodException
> {code}



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


[jira] [Created] (GROOVY-8021) Super in traits cause MissingMethodException

2016-12-14 Thread Daniil Ovchinnikov (JIRA)
Daniil Ovchinnikov created GROOVY-8021:
--

 Summary: Super in traits cause MissingMethodException
 Key: GROOVY-8021
 URL: https://issues.apache.org/jira/browse/GROOVY-8021
 Project: Groovy
  Issue Type: Bug
  Components: Static compilation
Affects Versions: 2.4.7
Reporter: Daniil Ovchinnikov


{code}
@CompileStatic
trait SimpleTrait {
void foo() {
super.foo()
}
}

@CompileStatic
class Foo implements SimpleTrait {}

new Foo().foo() // MissingMethodException
{code}



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


[jira] [Closed] (GROOVY-8017) unable to start any script using a CLIBuilder with groovy-all

2016-12-14 Thread Paul King (JIRA)

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

Paul King closed GROOVY-8017.
-
Resolution: Not A Problem
  Assignee: Paul King

> unable to start any script using a CLIBuilder with groovy-all
> -
>
> Key: GROOVY-8017
> URL: https://issues.apache.org/jira/browse/GROOVY-8017
> Project: Groovy
>  Issue Type: Bug
>  Components: groovy-runtime
>Affects Versions: 2.4.7
>Reporter: Michał Zegan
>Assignee: Paul King
>Priority: Minor
>
> It seems that groovy-all package does not work when trying to run a script 
> that uses a command line parser like groovy.util.CLIBuilder.
> I have tried to run my script directly, adding groovy-all and ivy to 
> classpath and using groovy.ui.GroovyMain as a main class. This is the error 
> that I got:
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> General error during class generation: java.lang.NoClassDefFoundError: Unable 
> to load class groovy.util.CliBuilder due to missing dependency 
> org/apache/commons/cli/ParseException



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


[jira] [Commented] (GROOVY-8017) unable to start any script using a CLIBuilder with groovy-all

2016-12-14 Thread JIRA

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

Michał Zegan commented on GROOVY-8017:
--

everything understood. You can close this issue

> unable to start any script using a CLIBuilder with groovy-all
> -
>
> Key: GROOVY-8017
> URL: https://issues.apache.org/jira/browse/GROOVY-8017
> Project: Groovy
>  Issue Type: Bug
>  Components: groovy-runtime
>Affects Versions: 2.4.7
>Reporter: Michał Zegan
>Priority: Minor
>
> It seems that groovy-all package does not work when trying to run a script 
> that uses a command line parser like groovy.util.CLIBuilder.
> I have tried to run my script directly, adding groovy-all and ivy to 
> classpath and using groovy.ui.GroovyMain as a main class. This is the error 
> that I got:
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> General error during class generation: java.lang.NoClassDefFoundError: Unable 
> to load class groovy.util.CliBuilder due to missing dependency 
> org/apache/commons/cli/ParseException



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