Inference/src/TypeSystem/EquivalenceClass.cs
/// <summary>
/// Clones a type to be used in SSA. It must taken into account that:
/// - In case it has no type variables, no clone is performed
/// - WriteType variables, equivalence classes and substitutions are cloned
/// </summary>
/// <param name="clonedTypeVariables">WriteType variables that have been cloned.</param>
/// <param name="equivalenceClasses">Equivalence classes of the type cloned variables. These
/// equivalence classes need to be updated with the new cloned type variables.</param>
/// <param name="methodAnalyzed">The method that is being analyzed when the operation is performed.</param>
/// <returns>The cloned type</returns>
Clones a type to be used in SSA. It must taken into account that:
In case it has no type variables, no clone is performed
WriteType variables, equivalence classes and substitutions are cloned
Clones a type to be used in SSA . It must taken into account that : In case it has no type variables no clone is performed WriteType variables equivalence classes and substitutions are cloned
internal void CloneTypeVariables(IDictionary<int, TypeVariable> clonedTypeVariables, IList<EquivalenceClass> equivalenceClasses, MethodType methodAnalyzed) {
            if (equivalenceClasses.Contains(this))
                return;
            equivalenceClasses.Add(this);
            if (this.substitution!=null)
                this.substitution.Clone(clonedTypeVariables, equivalenceClasses, methodAnalyzed);
            foreach (KeyValuePair<int, TypeVariable> pair in this.typeVariables)
                pair.Value.Clone(clonedTypeVariables, equivalenceClasses, methodAnalyzed);
        }
internal void CloneTypeVariables ( IDictionary < int , TypeVariable > clonedTypeVariables , IList < EquivalenceClass > equivalenceClasses , MethodType methodAnalyzed ) { if ( equivalenceClasses . Contains ( this ) ) return ; equivalenceClasses . Add ( this ) ; if ( this . substitution != null ) this . substitution . Clone ( clonedTypeVariables , equivalenceClasses , methodAnalyzed ) ; foreach ( KeyValuePair < int , TypeVariable > pair in this . typeVariables ) pair . Value . Clone ( clonedTypeVariables , equivalenceClasses , methodAnalyzed ) ; }
Clones a type to be used in SSA.
Clones a type to be used in SSA .
// * Checks if the equivalence class has been already cloned // * Adds class equivalence // * Clones, but not updates, the substitution // * Clones all the type variables in the equivalence class
The cloned type
The cloned type
clonedTypeVariables
IDictionary<int, TypeVariable>
WriteType variables that have been cloned.
WriteType variables that have been cloned .
equivalenceClasses
IList<EquivalenceClass>
Equivalence classes of the type cloned variables. These
equivalence classes need to be updated with the new cloned type variables.
Equivalence classes of the type cloned variables . These equivalence classes need to be updated with the new cloned type variables .
methodAnalyzed
MethodType
The method that is being analyzed when the operation is performed.
The method that is being analyzed when the operation is performed .