You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/11/02 19:02:00 UTC
[jira] [Resolved] (GROOVY-6925) Cannot enable static type checking on a method where static compilation has been disabled
[ https://issues.apache.org/jira/browse/GROOVY-6925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-6925.
---------------------------------
Fix Version/s: 5.0.0-alpha-1
Resolution: Fixed
https://github.com/apache/groovy/commit/d5a9406e20dafed9500b7c6dc1ed4246d17d094b
> 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)