createRestrictionBody

fun createRestrictionBody(methodBodyFunction: A_Function): A_Function

Create an A_Function to use as a semantic restriction body, based on the given method body function which must be a foldable primitive function. The semantic restriction function should invoke the receiver primitive (P_SimpleMethodStabilityHelper) to produce the narrowed return type at a call site.

Return

An [A_Function] to use as a semantic restriction body.

Parameters

methodBodyFunction
The [foldable][CanFold] primitive [A_Function] for which a stability
semantic restriction is to be created.