Inference/src/TypeSystem/UnionType.cs
/// <summary>
/// Replaces the equivalence class of 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>
/// <param name="previouslyUpdated">To detect infinite loops. Previously updated type expressions.</param>
Replaces the equivalence class of type variables substituting the old type variables for the new ones.
Replaces the equivalence class of type variables substituting the old type variables for the new ones .
public override void UpdateEquivalenceClass(IDictionary<TypeVariable, TypeVariable> typeVariableMappings, IList<TypeExpression> previouslyUpdated) {
            if (previouslyUpdated.Contains(this))
                return;
            previouslyUpdated.Add(this);
            if (!this.HasTypeVariables())
                return;
            foreach (TypeExpression type in this.typeSet)
                if (type.HasTypeVariables()) {
                    type.UpdateEquivalenceClass(typeVariableMappings, previouslyUpdated);
                    type.ValidTypeExpression = false;
                }
            this.ValidTypeExpression = false;
        }
public override void UpdateEquivalenceClass ( IDictionary < TypeVariable , TypeVariable > typeVariableMappings , IList < TypeExpression > previouslyUpdated ) { if ( previouslyUpdated . Contains ( this ) ) return ; previouslyUpdated . Add ( this ) ; if ( ! this . HasTypeVariables ( ) ) return ; foreach ( TypeExpression type in this . typeSet ) if ( type . HasTypeVariables ( ) ) { type . UpdateEquivalenceClass ( typeVariableMappings , previouslyUpdated ) ; type . ValidTypeExpression = false ; } this . ValidTypeExpression = false ; }
Replaces the equivalence class of type variables substituting the old type variables for the new ones.
Replaces the equivalence class of type variables substituting the old type variables for the new ones .
// * Checks infinite loops // * Updates the equivalence class
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 .
previouslyUpdated
IList<TypeExpression>
To detect infinite loops. Previously updated type expressions.
To detect infinite loops . Previously updated type expressions .