Warning: {value} doesn’t match the pattern of {what}
A constant is assigned, passed or returned where the declared type has a PATTERN it does
not match, like "12" for %String(PATTERN = "3N"). The constant may also be a property’s
InitialExpression or a formal argument’s default value. IRIS checks a property’s pattern
only when the object is validated or saved, and a mismatch then fails with ERROR #7209. It
never checks a formal argument or a return value. Match the pattern, or change it where the
type is declared.
IRIS compiles the example.
Class Demo.PatternMismatch Extends %RegisteredObject
{
Property Code As %String(PATTERN = "3N") [ InitialExpression = "1" ]; //! A7731
ClassMethod Take(code As %String(PATTERN = "3N")) As %String
{
Return code
}
ClassMethod Call() As %String
{
Set me = ..%New()
Set me.Code = "12" //! A7731
Return ..Take("abc") //! A7731
}
}