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

STC: error message for improper property initialization includes internal "<UnionType:"

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

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0-alpha-6
    • Static Type Checker
    • None

    Description

      Consider the following:

      class C {
        void setP(java.util.regex.Matcher matcher) {}
        void setP(java.util.regex.Pattern pattern) {}
      }
      @groovy.transform.TypeChecked test() {
        new C(p: new Object())
      }
      

      STC says "Cannot assign value of type java.lang.Object to variable of type <UnionType:java.util.regex.Matcher+java.util.regex.Pattern>"

      Attachments

        Activity

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

          People

            emilles Eric Milles
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment