internal override OverloadedTypeSymbol OverloadType(TypeSymbolBase newTypeSymBase)
        {
            OverloadedTypeSymbol symbol = newTypeSymBase as OverloadedTypeSymbol;

            if (symbol != null)
            {
                return(symbol.OverloadType(this));
            }
            TypeSymbol typeSym = newTypeSymBase as TypeSymbol;

            if ((typeSym != null) && this.CanOverload(typeSym))
            {
                return(new OverloadedTypeSymbol(this.name, this, typeSym));
            }
            return(null);
        }
Example #2
0
        internal override OverloadedTypeSymbol OverloadType(TypeSymbolBase newTypeSymBase)
        {
            OverloadedTypeSymbol newTypeOverload = newTypeSymBase as OverloadedTypeSymbol;

            if (newTypeOverload != null)
            {
                // We've encountered an overloaded type symbol over a previous simple
                // type symbol.
                return(newTypeOverload.OverloadType(this));
            }
            else
            {
                // We've encountered two simple types... just create an overload for them if
                // possible.
                TypeSymbol newTypeSym = newTypeSymBase as TypeSymbol;
                if (newTypeSym != null && this.CanOverload(newTypeSym))
                {
                    return(new OverloadedTypeSymbol(name, this, newTypeSym));
                }
            }

            return(null);
        }