private static IEnumerable <TypeUsage> UntypedNullAwareFlattenArgumentType(TypeUsage argType)
 {
     return(argType != null?TypeSemantics.FlattenType(argType) : new TypeUsage[]
     {
         null
     });
 }
示例#2
0
 private static IEnumerable <TypeUsage> UntypedNullAwareFlattenArgumentType(
     TypeUsage argType)
 {
     if (argType == null)
     {
         return((IEnumerable <TypeUsage>) new TypeUsage[1]);
     }
     return(TypeSemantics.FlattenType(argType));
 }
示例#3
0
 private static IEnumerable <TypeUsage> UntypedNullAwareFlattenParameterType(
     TypeUsage paramType,
     TypeUsage argType)
 {
     if (argType != null)
     {
         return(TypeSemantics.FlattenType(paramType));
     }
     return((IEnumerable <TypeUsage>) new TypeUsage[1]
     {
         paramType
     });
 }
 /// <summary>
 /// Resolves <paramref name="argTypes"/> against the list of function signatures.
 /// </summary>
 /// <returns>Funciton metadata</returns>
 internal static EdmFunction ResolveFunctionOverloads(IList <EdmFunction> functionsMetadata,
                                                      IList <TypeUsage> argTypes,
                                                      bool isGroupAggregateFunction,
                                                      out bool isAmbiguous)
 {
     return(ResolveFunctionOverloads(
                functionsMetadata,
                argTypes,
                (edmFunction) => edmFunction.Parameters,
                (functionParameter) => functionParameter.TypeUsage,
                (functionParameter) => functionParameter.Mode,
                (argType) => TypeSemantics.FlattenType(argType),
                (paramType, argType) => TypeSemantics.FlattenType(paramType),
                (fromType, toType) => TypeSemantics.IsPromotableTo(fromType, toType),
                (fromType, toType) => TypeSemantics.IsStructurallyEqual(fromType, toType),
                isGroupAggregateFunction,
                out isAmbiguous));
 }
示例#5
0
 internal static EdmFunction ResolveFunctionOverloads(
     IList <EdmFunction> functionsMetadata,
     IList <TypeUsage> argTypes,
     bool isGroupAggregateFunction,
     out bool isAmbiguous)
 {
     return(FunctionOverloadResolver.ResolveFunctionOverloads <EdmFunction, FunctionParameter>(functionsMetadata, argTypes, (Func <EdmFunction, IList <FunctionParameter> >)(edmFunction => (IList <FunctionParameter>)edmFunction.Parameters), (Func <FunctionParameter, TypeUsage>)(functionParameter => functionParameter.TypeUsage), (Func <FunctionParameter, ParameterMode>)(functionParameter => functionParameter.Mode), (Func <TypeUsage, IEnumerable <TypeUsage> >)(argType => TypeSemantics.FlattenType(argType)), (Func <TypeUsage, TypeUsage, IEnumerable <TypeUsage> >)((paramType, argType) => TypeSemantics.FlattenType(paramType)), (Func <TypeUsage, TypeUsage, bool>)((fromType, toType) => TypeSemantics.IsPromotableTo(fromType, toType)), (Func <TypeUsage, TypeUsage, bool>)((fromType, toType) => TypeSemantics.IsStructurallyEqual(fromType, toType)), isGroupAggregateFunction, out isAmbiguous));
 }
 private static IEnumerable <TypeUsage> UntypedNullAwareFlattenParameterType(TypeUsage paramType, TypeUsage argType)
 {
     return(argType != null?TypeSemantics.FlattenType(paramType) : new[] { paramType });
 }