ascot diagnostics

A3604

Error: Method ‘{name}’ overrides {cls}’s but {difference}

An override’s formal argument keeps the class the superclass declares, and its return class is the superclass’s or a subclass of it. A formal argument of a subclass of the declared class takes less than a caller holding the superclass may pass, and IRIS passes it anyway, untyped, so the override fails on it when it runs; one of any other class, a return class that is neither the declared one nor a subclass, and no return class where one is declared, IRIS refuses to compile (ERROR #5478 Keyword signature error). Two classes are the same here when a value of each serves as the other, so the datatypes, which IRIS converts between, are interchangeable where they are related; an untyped formal argument on either side is not compared. %OnNew is exempt, as for A1841.

IRIS rejects the example.

Class Demo.OverrideRefused Extends %Persistent
{

Method %OnBeforeSave(insert As %Boolean) As %String //! A3604
{
    Return insert
}

}

All diagnostics