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

Strange groovy behavior

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Duplicate
    • 2.4.5
    • None
    • None
    • None

    Description

      String s = 'anyString'
      Long l = 1
      
      def m = [(s): [l]] as Map<String,List<Long>>
      def g = 1
      

      Code above cause exception:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      /tmp/t.groovy: 5: expecting EOF, found 'def' @ line 5, column 1.
      

      If add `;` at the end of `def m = [(s): [l]] as Map<String,List<Long>>`, then all works fine.

      Attachments

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              gtors AndreyT
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: