You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2024/01/18 20:21:00 UTC

[jira] [Created] (GROOVY-11289) STC: error message for improper property initialization includes internal "
Eric Milles created GROOVY-11289:
------------------------------------

             Summary: STC: error message for improper property initialization includes internal "<UnionType:"
                 Key: GROOVY-11289
                 URL: https://issues.apache.org/jira/browse/GROOVY-11289
             Project: Groovy
          Issue Type: Improvement
          Components: Static Type Checker
            Reporter: Eric Milles


Consider the following:
{code:groovy}
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())
}
{code}

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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)