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 2020/09/07 03:29:00 UTC

[jira] [Assigned] (GROOVY-9660) Unexpected error when trait used as a generic type bound

     [ https://issues.apache.org/jira/browse/GROOVY-9660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King reassigned GROOVY-9660:
---------------------------------

    Assignee:     (was: Paul King)

> Unexpected error when trait used as a generic type bound
> --------------------------------------------------------
>
>                 Key: GROOVY-9660
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9660
>             Project: Groovy
>          Issue Type: Question
>          Components: Groovy Console
>    Affects Versions: 3.0.5
>         Environment: groovy 3.0.5 + jdk1.8
>            Reporter: hdfg159
>            Priority: Major
>              Labels: build
>
> *code example :*
> {code}
> trait Data {}
> class TestData implements Data {}
> class AbstractData<D extends Data>{ D data }
> def test = new AbstractData<TestData>()
> {code}
>  
> *when i compile groovy,it compile failed:*
> {noformat}
> 1 compilation error:
> The type TestData is not a valid substitute for the bounded parameter <D extends Data>
>  at line: 7, column: 29
> {noformat} 
> Is this the wrong way to write it?
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)