src/NFun/Tic/GraphBuilder.cs
/// <summary>
/// Merge already exists syntax node id,
/// or creates new one with specified type
/// </summary>
Merge already exists syntax node id,
or creates new one with specified type
Merge already exists syntax node id or creates new one with specified type
[MethodImpl(MethodImplOptions.AggressiveInlining)]
    private void MergeOrSetNode(int id, StateRefTo type) {
        var alreadyExists = _syntaxNodes.GetOrEnlarge(id);
        if (alreadyExists == null)
        {
            var res = TicNode.CreateSyntaxNode(id, type, true);
            _syntaxNodes[id] = res;
            return;
        }
        alreadyExists.State = SolvingFunctions.GetMergedStateOrNull(alreadyExists.State, type) ??
                              throw TicErrors.CannotSetState(alreadyExists, type);
    }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] private void MergeOrSetNode ( int id , StateRefTo type ) { var alreadyExists = _syntaxNodes . GetOrEnlarge ( id ) ; if ( alreadyExists == null ) { var res = TicNode . CreateSyntaxNode ( id , type , true ) ; _syntaxNodes [ id ] = res ; return ; } alreadyExists . State = SolvingFunctions . GetMergedStateOrNull ( alreadyExists . State , type ) ?? throw TicErrors . CannotSetState ( alreadyExists , type ) ; }
Merge already exists syntax node id,
or creates new one with specified type
Merge already exists syntax node id or creates new one with specified type
id
int
type
StateRefTo