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

Paul King closed GROOVY-6925.
-----------------------------

> Cannot enable static type checking on a method where static compilation has 
> been disabled
> -----------------------------------------------------------------------------------------
>
>                 Key: GROOVY-6925
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6925
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Static compilation, Static Type Checker
>    Affects Versions: 2.3.3
>            Reporter: Mauro Molinari
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.0-alpha-1
>
>
> Consider the following:
> {code}
> package j
> import groovy.transform.CompileStatic;
> import groovy.transform.TypeChecked;
> import groovy.transform.TypeCheckingMode;
> @CompileStatic
> class J {
>       
>   @CompileStatic(TypeCheckingMode.SKIP)
>   @TypeChecked(TypeCheckingMode.PASS)
>   void doSomething() {
>         Integer myString = myObject()
>   }
>   
>   Object myObject() {
>     return 1
>   }
> }
> {code}
> What I'm trying to say here is this: the class must be statically compiled, 
> except for the {{doSomething()}} method. However, I'd like to have at least 
> static type checking on that method. Unfortunately, this does not work: 
> Groovy does not complain that {{myString}} assignment is not valid.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to