[
https://issues.apache.org/jira/browse/GROOVY-10373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-10373.
----------------------------------
Fix Version/s: 5.0.0-alpha-1
Resolution: Fixed
https://github.com/apache/groovy/commit/6b31aa69287726a0a19b4784d9d043ea5130a43f
> STC cannot compile program with multiple bounded type parameters
> ----------------------------------------------------------------
>
> Key: GROOVY-10373
> URL: https://issues.apache.org/jira/browse/GROOVY-10373
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation, Static Type Checker
> Affects Versions: 4.0.0-beta-2
> Reporter: Stefanos Chaliasos
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.0-alpha-1
>
>
> I have the following Groovy program.
> {code:groovy}
> @groovy.transform.CompileStatic
> class Main<I extends B<Character>> {
> void main() {
> C<I> x = (C<I>) null
> x.foo().bar(null)
> }
> }
> class A<I, E extends I> {
> void bar(E y) {}
> }
> class B<T> {}
> class C<S extends B<Character>> {
> A<S, ? extends S> foo() { (A<S, ? extends S>) null}
> }
> {code}
> h2. Actual Behavior
> {code:java}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> failed:
> Main.groovy: 4: [Static type checking] - Cannot call A#bar(B) with arguments
> [<unknown parameter type>]
> @ line 4, column 5.
> x.foo().bar(null)
> ^
> 1 error
> {code}
> h2. Expected behavior
> Compile successfully.
> h2. Comment
> This should be a regression bug because groovyc 4.0.0-alpha-3 compiles the
> program successfully
> h2. Affected Version
> master (commit: e453db968df3753dc6c26d51168b944137c8e4b1)
--
This message was sent by Atlassian Jira
(v8.20.7#820007)