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 2019/04/30 08:25:00 UTC
[jira] [Resolved] (GROOVY-8990) No compiler error for mismatched
generics when using &
[ https://issues.apache.org/jira/browse/GROOVY-8990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-8990.
-------------------------------
Resolution: Fixed
Assignee: Paul King
Fix Version/s: 2.5.7
3.0.0-beta-1
Proposed PR merged.
> No compiler error for mismatched generics when using &
> ------------------------------------------------------
>
> Key: GROOVY-8990
> URL: https://issues.apache.org/jira/browse/GROOVY-8990
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 2.4.16, 3.0.0-alpha-4, 2.5.6
> Reporter: Eric Milles
> Assignee: Paul King
> Priority: Major
> Fix For: 3.0.0-beta-1, 2.5.7
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Consider the following:
> {code:java}
> interface I {}
> class C<T extends Number & I> { T meth() {} }
> class X extends C<Integer> {} // should produce error "The type Integer is not a valid substitute for the bounded parameter <T extends java.lang.Number & I>"
> new C<Integer>() // should produce error "The type Integer is not a valid substitute for the bounded parameter <T extends java.lang.Number & I>"
> {code}
> If the type bound Number is not satisfied, an error is produced. However, failure to satisfy the additional interface(s) does not produce a compiler error.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)