You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/11/17 13:13:00 UTC
[jira] [Assigned] (GROOVY-10373) STC cannot compile program with multiple bounded type parameters
[ https://issues.apache.org/jira/browse/GROOVY-10373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-10373:
------------------------------------
Assignee: Eric Milles
> 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
>
> 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.1#820001)