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

CompilationError for [[1]] as List<List<Integer>>

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.7, 2.4.0-beta-3
    • 3.0.0
    • Compiler
    • None

    Description

      I can run this code,

      def list = ([[1]] as List<List<Integer>>)
      println list
      

      but cannot run this code.

      def list = [[1]] as List<List<Integer>>
      println list
      

      Error message:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      C:\Users\Yu\Desktop\test.groovy: 2: expecting EOF, found 'println' @ line 2, column 1.
         println list
         ^
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            yukoba Yu Kobayashi
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: