Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.15, 3.0.8
-
None
-
macOS 10.15.7
OpenJDK Zulu 11.0.3
Groovy 3.0.8
Gradle 6.8
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!
Attachments
Attachments
Issue Links
- relates to
-
GROOVY-10815 SC: Access is forbidden for property-style access to getProperties() default Groovy method
- Closed