src/NFun/Tic/GraphBuilder.cs
/// <summary>
/// Set function call, of already known functional type 
/// </summary>
Set function call, of already known functional type
Set function call of already known functional type
public void SetCall(StateFun funState, params int[] argThenReturnIds) {
        if (funState.ArgsCount != argThenReturnIds.Length - 1)
            throw new ArgumentException("Sizes of type and id array have to be equal");
        RegistrateCompositeType(funState);
        for (int i = 0; i < funState.ArgsCount; i++)
        {
            var state = funState.ArgNodes[i].State;
            if (state is ConstrainsState)
                state = new StateRefTo(funState.ArgNodes[i]);
            SetCallArgument(state, argThenReturnIds[i]);
        }
        var returnId = argThenReturnIds[^1];
        var returnNode = GetOrCreateNode(returnId);
        SolvingFunctions.MergeInplace(funState.RetNode, returnNode);
    }
public void SetCall ( StateFun funState , params int [ ] argThenReturnIds ) { if ( funState . ArgsCount != argThenReturnIds . Length - 1 ) throw new ArgumentException ( " " ) ; RegistrateCompositeType ( funState ) ; for ( int i = 0 ; i < funState . ArgsCount ; i ++ ) { var state = funState . ArgNodes [ i ] . State ; if ( state is ConstrainsState ) state = new StateRefTo ( funState . ArgNodes [ i ] ) ; SetCallArgument ( state , argThenReturnIds [ i ] ) ; } var returnId = argThenReturnIds [ ^ 1 ] ; var returnNode = GetOrCreateNode ( returnId ) ; SolvingFunctions . MergeInplace ( funState . RetNode , returnNode ) ; }
Set function call, of already known functional type
Set function call of already known functional type
funState
StateFun