Inference/src/TypeSystem/Constraints/CloneConstraint.cs
/// <summary>
/// Method that clones each type variable of a constraint.
/// Equivalence classes are not cloned (but included in the equivalenceClasses parameter.
/// </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="equivalenceClasses">Each equivalence class of all the type variables.</param>
/// <returns>The new type expression (itself by default)</returns>
Method that clones each type variable of a constraint.
Equivalence classes are not cloned (but included in the equivalenceClasses parameter.
Method that clones each type variable of a constraint . Equivalence classes are not cloned ( but included in the equivalenceClasses parameter .
public override Constraint CloneTypeVariables(IDictionary<TypeVariable, TypeVariable> typeVariableMappings, IList<EquivalenceClass> equivalenceClasses) {
            TypeExpression newFirstOperand = this.FirstOperand.CloneTypeVariables(typeVariableMappings, equivalenceClasses, new List<ClassType>());
            TypeVariable newReturnType = (TypeVariable)this.ReturnType.CloneTypeVariables(typeVariableMappings, equivalenceClasses, new List<ClassType>());
            return new CloneConstraint(newFirstOperand, newReturnType);
        }
public override Constraint CloneTypeVariables ( IDictionary < TypeVariable , TypeVariable > typeVariableMappings , IList < EquivalenceClass > equivalenceClasses ) { TypeExpression newFirstOperand = this . FirstOperand . CloneTypeVariables ( typeVariableMappings , equivalenceClasses , new List < ClassType > ( ) ) ; TypeVariable newReturnType = ( TypeVariable ) this . ReturnType . CloneTypeVariables ( typeVariableMappings , equivalenceClasses , new List < ClassType > ( ) ) ; return new CloneConstraint ( newFirstOperand , newReturnType ) ; }
Method that clones each type variable of a constraint.
Method that clones each type variable of a constraint .
The new type expression (itself by default)
The new type expression ( itself by default )
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
equivalenceClasses
IList<EquivalenceClass>
Each equivalence class of all the type variables.
Each equivalence class of all the type variables .