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 2023/02/07 22:36:00 UTC

[jira] [Commented] (GROOVY-10928) Invalid stub code for interface field

    [ https://issues.apache.org/jira/browse/GROOVY-10928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17685598#comment-17685598 ] 

Eric Milles commented on GROOVY-10928:
--------------------------------------

fixed in 4.0.10 and 3.0.16 -- unless they stop the release train

> Invalid stub code for interface field
> -------------------------------------
>
>                 Key: GROOVY-10928
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10928
>             Project: Groovy
>          Issue Type: Bug
>          Components: Stub generator / Joint compiler
>    Affects Versions: 4.0.8
>            Reporter: Christopher Smith
>            Assignee: Eric Milles
>            Priority: Major
>
> When compiling this interface:
> {code:groovy}
> @CompileStatic
> interface Service {
>   TypeReference<Map<String, Object>> STATE_TYPE_MAP = new TypeReference<Map<String, Object>>(){}
> }
> {code}
> the stub generator produces code that does not compile under Java 11:
> {code:java}
> @groovy.transform.CompileStatic() public interface Service
> <T> {
> ;
> com.fasterxml.jackson.core.type.TypeReference<java.util.Map<java.lang.String, java.lang.Object>> STATE_TYPE_MAP;
> static { STATE_TYPE_MAP = null; }
> {code}
> {code}
> [ERROR] Service.java:[6,112] = expected
> [ERROR] Service.java:[7,8] initializers not allowed in interfaces
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)