Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.5
-
None
Description
The typechecker does not realize that the <T> of the method shadows the <T> of the class and compiles this code without warning. The same code does not typecheck in Java.
public class GoodCodeRed<T> { Collection<GoodCodeRed<T>> attached @groovy.transform.CompileStatic public <T> void attach(GoodCodeRed<T> toAttach) { attached.add(toAttach) } }
Attachments
Issue Links
- relates to
-
GROOVY-7719 Type incompatibility of generic placeholders not detected for method called on field
- Open