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

@CompileStatic not recognising Literal list when LHS is a concrete list type

    XMLWordPrintableJSON

Details

    Description

      Compiling this code:

      @CompileStatic
      class X {
          ArrayList list = [1,2,3]
      }
      

      or this:

      @CompileStatic
      def method() {
          ArrayList list = [1,2,3]
      }
      

      gives:

      [Static type checking] - No matching constructor found: java.util.ArrayList <E extends java.lang.Object -> java.lang.Object><init>(int, int, int)
      

      Attachments

        Activity

          People

            emilles Eric Milles
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: