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

Strange compilation error with an "as" cast and a nested generics map

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.8.6, 2.4.7
    • None
    • parser
    • None
    • *

    Description

      Bad Groovy
      def myMap = [:] as Map<String, Map<String,String>>
      def foo = ''
      

      tells:

      Error
      1 compilation error:
      
      expecting EOF, found 'def' at line: 2, column: 1
      

      but:

      Good Groovy
      def myMap = [:] as Map<String, Map<String,String> >
      def bar = ''
      

      works fine.

      Difference lies between >> and > > (with space).

      Fix "Bad Groovy" assignment.

      Attachments

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              MaikIgloffstein Maik Igloffstein
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: