Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have the following program
class A<T> { T x; A(T x) { this.x = x; } } public class Main { public static void main(String[] args) { bar((new A<>("")).x); } public static void bar(String x) {} }
Actual Behaviour
I get the following compile-time error
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 11: [Static type checking] - Cannot find matching method Main#bar(T). Please check if the declared type is correct and if the method exists. @ line 11, column 5. bar((new A<>("")).x); ^1 error
Expected Behaviour
Compile successfully
Tested on: https://github.com/apache/groovy/commit/715c34edc82261544b8715bc2253b0b3f05bdbad