Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.2
-
MacOS X
Oracle JDK 1.7u75 / 1.8u40
Maven 3.0.5
Description
Most of the time, I get the following compilation error:
[ERROR] /Users/fpavageau/devs/bugs/lost-cascading-types/src/main/groovy/BadType.groovy: 22: [Static type checking] - No such property: start for class: T [ERROR] @ line 22, column 22. [ERROR] println("" + rel.currentState.state.start) [ERROR] ^ [ERROR] [ERROR] 1 error
where rel is an instance of a non-parameterized (Java) class implementing a generic interface with the currentState generic property. So the type of the property should actually be known, but it's lost and I get a compilation error because the start property is not part of the lower-bound type of currentState.
When I say "most of the time", it's because the compilation error is not always triggered (so lots of debugging fun!). I've tried with Oracle JDK 1.7u75 and 1.8u40, and I get around 87% of failures:
$ failures=0; for i in {1..100}; do mvn clean package > /dev/null 2>&1 || ((failures++)); done; echo $failures 87
$ failures=0; for i in {1..100}; do mvn clean package > /dev/null 2>&1 || ((failures++)); done; echo $failures 88
I'm attaching a test case, which is also available on Github.
Attachments
Attachments
Issue Links
- relates to
-
GROOVY-11341 @CompileStatic: Compilation fails due to a synthetic bridge method in the subclass
- Closed