Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10928

Invalid stub code for interface field

    XMLWordPrintableJSON

Details

    Description

      When compiling this interface:

      @CompileStatic
      interface Service {
        TypeReference<Map<String, Object>> STATE_TYPE_MAP = new TypeReference<Map<String, Object>>(){}
      }
      

      the stub generator produces code that does not compile under Java 11:

      @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; }
      
      [ERROR] Service.java:[6,112] = expected
      [ERROR] Service.java:[7,8] initializers not allowed in interfaces
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              chrylis Christopher Smith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: