Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
4.0.0-alpha-2
-
None
-
None
Description
I have the following Groovy program.
@groovy.transform.TypeChecked class Main { public static final void main(String[] args) { final A<Float> a = new A<Float>() a.foo(10) a.bar(10) // Fails here } } final class A<T> { final void foo(Float x) {} final void bar(T x) {} }
Actual Behavior
The program does not compile, and I get the following error.
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Main.groovy: 6: [Static type checking] - Cannot call A <Float>#bar(java.lang.Float) with arguments [int] @ line 6, column 5. a.bar(10) ^ 1 error
Expected Behavior
Compile successfully.