New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Groovy 2.0 @CompileStatic compability #29

Closed
andresteingress opened this Issue Oct 3, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@andresteingress
Owner

andresteingress commented Oct 3, 2012

No description provided.

@jmisur

This comment has been minimized.

Show comment
Hide comment
@jmisur

jmisur Nov 15, 2012

Hi, I cannot make this simple example run with @CompileStatic
(groovy-all 2.0.4, gcontracts-core 1.2.10, java 1.6, inside Groovy/Grails Tool Suite - groovy compiler set to 2.0.4)
What am I doing wrong?

import org.gcontracts.annotations.Requires

@CompileStatic
public class App {

    @Requires({x == null})   // x undeclared
    String yyy(String x) {
        println x
        x
    }

    @Requires({x > 3})   // x undeclared
    String xxx(int x){
        yyy('aa')
    }

    public static void main( String[] args ) {
        new App().xxx(4)
    }
}

jmisur commented Nov 15, 2012

Hi, I cannot make this simple example run with @CompileStatic
(groovy-all 2.0.4, gcontracts-core 1.2.10, java 1.6, inside Groovy/Grails Tool Suite - groovy compiler set to 2.0.4)
What am I doing wrong?

import org.gcontracts.annotations.Requires

@CompileStatic
public class App {

    @Requires({x == null})   // x undeclared
    String yyy(String x) {
        println x
        x
    }

    @Requires({x > 3})   // x undeclared
    String xxx(int x){
        yyy('aa')
    }

    public static void main( String[] args ) {
        new App().xxx(4)
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment