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

Parrot parser incorrectly treats an expression wrapped in parentheses as a cast

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.12
    • None
    • parser-antlr4
    • None

    Description

      Trying to compile this code:

      def a = ""
      (a) in []
      

      results in

      /path/to/file/Foo.groovy: 10: unable to resolve class a
       @ line 21, column 9.
                 (a) in []
                 ^
      
      1 error
      

      Obviously the parentheses are not necessary and the problem goes away if you drop them but it would be good if that code was still allowed like it was in 2.5 or if at least the error wasn't so confusing.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              erdi Marcin Erdmann
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: