Inference/src/TypeSystem/UnionType.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 override TypeExpression Clone(IDictionary<int, TypeVariable> clonedTypeVariables, IList<EquivalenceClass> equivalenceClasses, MethodType methodAnalyzed) {
            if (!this.HasTypeVariables())
                return this;
            UnionType newUnionType = (UnionType)this.MemberwiseClone();
            newUnionType.typeSet = new List<TypeExpression>();
            foreach (TypeExpression type in this.typeSet)
                newUnionType.typeSet.Add(type.Clone(clonedTypeVariables, equivalenceClasses, methodAnalyzed));
            return newUnionType;
        }
internal override TypeExpression Clone ( IDictionary < int , TypeVariable > clonedTypeVariables , IList < EquivalenceClass > equivalenceClasses , MethodType methodAnalyzed ) { if ( ! this . HasTypeVariables ( ) ) return this ; UnionType newUnionType = ( UnionType ) this . MemberwiseClone ( ) ; newUnionType . typeSet = new List < TypeExpression > ( ) ; foreach ( TypeExpression type in this . typeSet ) newUnionType . typeSet . Add ( type . Clone ( clonedTypeVariables , equivalenceClasses , methodAnalyzed ) ) ; return newUnionType ; }
Clones a type to be used in SSA.
Clones a type to be used in SSA .
// * Clones all the types in the union
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 .