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

code generator fails to cast argument to "~" to string

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.0-beta-8
    • None
    • None
    • Windows XP

    Description

      This test program demonstrates the problem:

      import java.util.regex.Matcher;
      import java.util.regex.Pattern;

      // This use of "~" works.
      pattern = ~ "
      .groovy$";
      println "pattern from constant is: " + pattern;

      // This use of "~" produces an error.
      string = "
      .groovy$";
      println "string is: " + string;
      pattern = ~ string;

      The top of the error trace is:

      java.lang.VerifyError: (class: foo, method: run signature:
      ()Ljava/lang/Object Incompatible argument to function

      Attachments

        Activity

          People

            Unassigned Unassigned
            gvwilson Greg Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: