Error: {source} is incompatible with {target}
The value of this Quit or Return has a class that is neither the method’s return type
nor a subclass of it. IRIS compiles the method all the same. The caller trusts the declared
return type and fails when it uses the value as that class, here with
<METHOD DOES NOT EXIST>. Return an instance of the declared class, or change the return
type to the class returned.
IRIS compiles the example, and do ##class(Demo.TypeIncompatible).Call() raises <METHOD DOES NOT EXIST> when it runs.
Class Demo.TypeIncompatible
{
ClassMethod Names() As %ListOfDataTypes
{
Quit ##class(%ArrayOfDataTypes).%New() //! A5967
}
ClassMethod Call() As %Status
{
Set names = ..Names()
Quit names.Insert("Ann")
}
}