Class CovariantBridges
EK9 lets an override narrow its return type (make() <- rtn as Circle over a parent's <- rtn as Shape),
and the object decides which method runs, never the reference or the return type. A JVM method's identity includes
its return type, so without a bridge a call through the parent's type never reaches the override: the parent's
body ran silently, or an abstract parent failed with AbstractMethodError. Each operation records the parent return
types it narrows (OperationInstr.getBridgeReturnTypes()), computed here from the symbols by THE
OverriddenDeclarations - the same lookup phase 3's override rule uses - so no back end re-derives it from
the symbol table at code-generation time (which incremental builds could not see).
Hold one and give it each IR module. Idempotent: recomputed from the symbols each time. A method is looked at only
if it is an override; a function only for its _call.
-
Constructor Details
-
CovariantBridges
public CovariantBridges()
-
-
Method Details
-
accept
-