[
https://issues.apache.org/jira/browse/GROOVY-10698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-10698:
---------------------------------
Fix Version/s: 4.0.5
(was: 5.0.0-alpha-1)
> Fail to infer the type argument when using nested diamond operator
> ------------------------------------------------------------------
>
> Key: GROOVY-10698
> URL: https://issues.apache.org/jira/browse/GROOVY-10698
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Thodoris Sotiropoulos
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.5
>
>
> I have the following program
> {code}
> class A<T> {
> A(T x, B<T> y) {}
> }
> class B<X> {}
> class Test {
> void test() {
> new A<>("fda", new B<>())
> }
> }
> {code}
> h3. Actual behavior
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> failed:
> test.groovy: 10: [Static type checking] - Cannot call
> A#<init>(java.lang.Object, B<java.lang.Object>) with arguments
> [java.lang.String, B<T>]
> @ line 10, column 5.
> new A<>("fda", new B<>())
> ^
> 1 error
> {code}
> h3. Expected behavior
> Compile successfully.
> Tested against master (commit: 63bcab1bf13fb3811626fb1727c22e86528feb7f)
> **Notes:**
> - this bug occurs when the type parameters of class A and B involve
> different names
> - this bug is not triggered is groovy 4.0.2. It is introduced in groovy
> 4.0.3.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)