Esempio n. 1
0
        internal static TypeUsage GetCommonTypeUsage(IEnumerable <TypeUsage> types)
        {
            TypeUsage commonType = null;

            foreach (var testType in types)
            {
                if (null == testType)
                {
                    return(null);
                }

                if (null == commonType)
                {
                    commonType = testType;
                }
                else
                {
                    commonType = TypeSemantics.GetCommonType(commonType, testType);
                    if (null == commonType)
                    {
                        break;
                    }
                }
            }
            return(commonType);
        }
        internal static TypeUsage GetCommonTypeUsage(IEnumerable <TypeUsage> types)
        {
            TypeUsage type1 = (TypeUsage)null;

            foreach (TypeUsage type in types)
            {
                if (type == null)
                {
                    return((TypeUsage)null);
                }
                if (type1 == null)
                {
                    type1 = type;
                }
                else
                {
                    type1 = TypeSemantics.GetCommonType(type1, type);
                    if (type1 == null)
                    {
                        break;
                    }
                }
            }
            return(type1);
        }
Esempio n. 3
0
 internal static TypeUsage GetCommonTypeUsage(TypeUsage typeUsage1, TypeUsage typeUsage2)
 {
     return(TypeSemantics.GetCommonType(typeUsage1, typeUsage2));
 }