You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/02/03 22:33:00 UTC
[jira] [Closed] (GROOVY-6919) Static compilation fails with multiple bounds generics
[ https://issues.apache.org/jira/browse/GROOVY-6919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-6919.
-----------------------------
> Static compilation fails with multiple bounds generics
> ------------------------------------------------------
>
> Key: GROOVY-6919
> URL: https://issues.apache.org/jira/browse/GROOVY-6919
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 2.3.3, 2.4.0-rc-1
> Reporter: Mauro Molinari
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.0-beta-2
>
>
> Consider the following interfaces:
> {code:java}
> public interface H1 {
> String getFoo();
> }
> {code}
> {code:java}
> public interface H2 {
> String getBar();
> }
> {code}
> and the following Groovy class:
> {code}
> @CompileStatic
> class HGroovy {
> public <T extends H1 & H2> void doSomething(T obj) {
> obj.foo
> obj.bar
> }
> }
> {code}
> Compilation fails:
> {noformat}
> HGroovy.groovy: 9: [Static type checking] - No such property: bar for class: T
> @ line 9, column 3.
> obj.bar
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)