Inference/src/TypeSystem/UnionType.cs
/// <summary>
/// Adds a new type expression.
/// </summary>
/// <param name="type">WriteType expression to add.</param>
/// <returns>If the type has been added</returns>
Adds a new type expression.
Adds a new type expression .
public bool AddType(TypeExpression type) {
            bool added = true;
            UnionType union = type as UnionType;
            if (union != null) {
                foreach (TypeExpression t in union.typeSet)
                    added = this.AddType(t) && added;
                this.ValidTypeExpression = false;
                return added;
            }
            TypeExpression existingType = typeSet.Find(type.Equals);
            if (existingType == null) {
                this.typeSet.Add(type);
                this.ValidTypeExpression = false;
                return true;
            }
            return false;
        }
public bool AddType ( TypeExpression type ) { bool added = true ; UnionType union = type as UnionType ; if ( union != null ) { foreach ( TypeExpression t in union . typeSet ) added = this . AddType ( t ) && added ; this . ValidTypeExpression = false ; return added ; } TypeExpression existingType = typeSet . Find ( type . Equals ) ; if ( existingType == null ) { this . typeSet . Add ( type ) ; this . ValidTypeExpression = false ; return true ; } return false ; }
Adds a new type expression.
Adds a new type expression .
If the type has been added
If the type has been added
type
TypeExpression
WriteType expression to add.
WriteType expression to add .