Warning: {value} doesn’t match the pattern of {what}
A constant that doesn’t match the PATTERN of the type it is assigned to, passed as or
returned as, or declared as a property’s InitialExpression or a parameter’s default:
"12" for a %String(PATTERN = "3N"). IRIS holds a property to its pattern
only when the object is validated or saved, which fails with ERROR #7209, and a method
argument, a local or a return value never, so the value goes through. Match the pattern, or
widen it where it 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
}
}