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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.3
    • 2.4.4
    • Compiler
    • None
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment