You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Felix Scheinost (Jira)" <ji...@apache.org> on 2021/05/07 16:16:00 UTC

[jira] [Updated] (GROOVY-10075) Static compiler incorrectly typechecks extension modules

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

Felix Scheinost updated GROOVY-10075:
-------------------------------------
    Description: 
I think I found a bug in static typechecking of extension modules.

I tested two variants:
 # Fixed generic: _static void getTestString(List<String> self)_
 ## In this case the bug affects both method calls and property access e.g. _integerList.getTestString()_ and _integerList__.testString_ both compile
 # With generic constraint: _static <S extends String> void getTestStringOrSubclass(List<S> self)_ 
 ## In this case the bug only affects property access e.g. _integerList.__getTestStringOrSubclass__()_ doesn't compile but _integerList.testStringOrSubclass_ compiles

I prepared an example project here: [https://github.com/felixscheinost/test-groovy-static-extensions]

Please have a look at [https://github.com/felixscheinost/test-groovy-static-extensions/blob/master/src/main/groovy/org/example/App.groovy]

 

Thanks!

  was:
I think I found a bug in static typechecking of extension modules.

I tested two variants:
 # Fixed generic: _static void getTestString(List<String> self)_
 ## In this case the bug affects both method calls e.g. _integerList.getTestString()_ and _integerList__.testString_ both compile
 # With generic constraint: _static <S extends String> void getTestStringOrSubclass(List<S> self)_ 
 ## In this case the bug only affects property access e.g. _integerList.__getTestStringOrSubclass__()_ doesn't compile but _integerList.testStringOrSubclass_ compiles

I prepared an example project here: [https://github.com/felixscheinost/test-groovy-static-extensions]

Please have a look at [https://github.com/felixscheinost/test-groovy-static-extensions/blob/master/src/main/groovy/org/example/App.groovy]

 

Thanks!


> Static compiler incorrectly typechecks extension modules
> --------------------------------------------------------
>
>                 Key: GROOVY-10075
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10075
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.4.15, 3.0.8
>         Environment: macOS 10.15.7
> OpenJDK Zulu 11.0.3
> Groovy 3.0.8
> Gradle 6.8
>            Reporter: Felix Scheinost
>            Priority: Major
>
> I think I found a bug in static typechecking of extension modules.
> I tested two variants:
>  # Fixed generic: _static void getTestString(List<String> self)_
>  ## In this case the bug affects both method calls and property access e.g. _integerList.getTestString()_ and _integerList__.testString_ both compile
>  # With generic constraint: _static <S extends String> void getTestStringOrSubclass(List<S> self)_ 
>  ## In this case the bug only affects property access e.g. _integerList.__getTestStringOrSubclass__()_ doesn't compile but _integerList.testStringOrSubclass_ compiles
> I prepared an example project here: [https://github.com/felixscheinost/test-groovy-static-extensions]
> Please have a look at [https://github.com/felixscheinost/test-groovy-static-extensions/blob/master/src/main/groovy/org/example/App.groovy]
>  
> Thanks!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)