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 00:48:00 UTC
[jira] [Assigned] (GROOVY-10928) Invalid stub code for interface field
[ https://issues.apache.org/jira/browse/GROOVY-10928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-10928:
------------------------------------
Assignee: Eric Milles
> 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)