importMethod Call

The importMethod call (invocation) instruction enables you to send a message to an imported method. For details about importing packages, see Chapter 8, "Using Packages".

Syntax

The syntax of an importMethod call is:

expression := class‑instance.importMethod imported-method-name;

expression.type-guard.importMethod imported-method-name;

Description

Use an importMethod call to cause the imported method specified by imported-method-name to be invoked for the instance referred to by the expression.

If the imported method being called takes no parameters, the parentheses on the imported method call are optional.

In cases where a locally defined method has the same name as an exported method, developers in the importing schema can use the importMethod call to specify that it is the imported method that is to be invoked.

When calling an imported method, the following rules apply.

When invoking an Object subschema copy method via a reference of type Object and that method has the same name as an imported method, binding to the local Object method by default is necessary to preserve the behavior of existing code.