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

Interpolated variable followed by asterisk in slashy-string causes compiler error

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.3
    • Fix Version/s: 2.4.4
    • Component/s: Compiler
    • Labels:
      None
    • Environment:
      Windows 7 via gvm
      Java 1.8_40

      Description

      @Test
      void slashyStringWithInterpolatedVariableFollowedByAsterisk() {
              // currently throws org.codehaus.groovy.control.MultipleCompilationErrorsException
          assert Eval.me('''def foo='bar'; /$foo*baz/''') == 'bar*baz'
          assert Eval.me('''def foo='bar'; /${foo}*baz/''') == 'bar*baz'
          assert Eval.me('''def foo='bar'; /$foo\u002abaz/''') == 'bar*baz'
          assert Eval.me('''def foo='bar'; /${foo}\u002abaz/''') == 'bar*baz'
      }
      

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              nealm Martin Neal
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: