You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2019/07/13 18:00:00 UTC

[jira] [Resolved] (GROOVY-9191) Cannot compile generic method without public keyword

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

Daniel Sun resolved GROOVY-9191.
--------------------------------
       Resolution: Fixed
         Assignee: Daniel Sun
    Fix Version/s: 3.0.0-beta-2

Groovy 3.0.0-beta-2 can run your code properly.

{code:java}
class Example {
  <T> T get(T value) {
    value
  }
}

assert 1 == new Example().get(1)
{code}

P.S. the old parser is lack of maintainance and is replaced with the new Parrot parser in 3.0.0

> Cannot compile generic method without public keyword
> ----------------------------------------------------
>
>                 Key: GROOVY-9191
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9191
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.5.7
>         Environment: Windows 10(1803)
>            Reporter: Минск
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 3.0.0-beta-2
>
>
> {code:groovy}
> class Example {
>   <T> T get(T value) {
>     value
>   }
> }{code}
> unexpected token: <
> {code:groovy}
> class Example {
>   public <T> T get(T value) {
>     value
>   }
> }{code}
> works fine



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)