Inference/src/TypeSystem/UnionType.cs
/// <summary>
/// Replaces type variables substituting the old type variables for the new ones.
/// </summary>
/// <param name="typeVariableMappings">Each new type varaiable represent a copy of another existing one.
/// This parameter is a mapping between them, wher tmpName=old and value=new.</param>
Replaces type variables substituting the old type variables for the new ones.
Replaces type variables substituting the old type variables for the new ones .
public override void ReplaceTypeVariables(IDictionary<TypeVariable, TypeVariable> typeVariableMappings) {
            if (!this.HasTypeVariables())
                return;
            for (int i = 0; i < this.typeSet.Count; i++) {
                TypeVariable typeVariable = this.typeSet[i] as TypeVariable;
                if (typeVariable == null) {
                    if (this.typeSet[i].HasTypeVariables())
                        this.typeSet[i].ReplaceTypeVariables(typeVariableMappings);
                }
                else if (typeVariableMappings.ContainsKey(typeVariable))
                    this.typeSet[i] = typeVariableMappings[typeVariable];
                this.ValidTypeExpression = false;
            }
        }
public override void ReplaceTypeVariables ( IDictionary < TypeVariable , TypeVariable > typeVariableMappings ) { if ( ! this . HasTypeVariables ( ) ) return ; for ( int i = 0 ; i < this . typeSet . Count ; i ++ ) { TypeVariable typeVariable = this . typeSet [ i ] as TypeVariable ; if ( typeVariable == null ) { if ( this . typeSet [ i ] . HasTypeVariables ( ) ) this . typeSet [ i ] . ReplaceTypeVariables ( typeVariableMappings ) ; } else if ( typeVariableMappings . ContainsKey ( typeVariable ) ) this . typeSet [ i ] = typeVariableMappings [ typeVariable ] ; this . ValidTypeExpression = false ; } }
Replaces type variables substituting the old type variables for the new ones.
Replaces type variables substituting the old type variables for the new ones .
typeVariableMappings
IDictionary<TypeVariable, TypeVariable>
Each new type varaiable represent a copy of another existing one.
This parameter is a mapping between them, wher tmpName=old and value=new.
Each new type varaiable represent a copy of another existing one . This parameter is a mapping between them wher tmpName = old and value = new .