示例#1
0
 public override Conversion IsValid(IType[] parameterTypes, IType returnType, Conversions conversions)
 {
     Assert.AreEqual(expectedParameterTypes, parameterTypes);
     return(conversions.ImplicitConversion(inferredReturnType, returnType));
 }
示例#2
0
 public override Conversion IsValid(IType[] parameterTypes, IType returnType, Conversions conversions)
 {
     return(conversions.ImplicitConversion(inferredReturnType, returnType));
 }
示例#3
0
        public OverloadResolution(ICompilation compilation, ResolveResult[] arguments, string[] argumentNames = null, IType[] typeArguments = null, Conversions conversions = null)
        {
            if (compilation == null)
            {
                throw new ArgumentNullException("compilation");
            }
            if (arguments == null)
            {
                throw new ArgumentNullException("arguments");
            }
            if (argumentNames == null)
            {
                argumentNames = new string[arguments.Length];
            }
            else if (argumentNames.Length != arguments.Length)
            {
                throw new ArgumentException("argumentsNames.Length must be equal to arguments.Length");
            }
            this.compilation   = compilation;
            this.arguments     = arguments;
            this.argumentNames = argumentNames;

            // keep explicitlyGivenTypeArguments==null when no type arguments were specified
            if (typeArguments != null && typeArguments.Length > 0)
            {
                this.explicitlyGivenTypeArguments = typeArguments;
            }

            this.conversions          = conversions ?? Conversions.Get(compilation);
            this.AllowExpandingParams = true;
        }
示例#4
0
 public ConstraintValidatingSubstitution(IList <IType> classTypeArguments, IList <IType> methodTypeArguments, OverloadResolution overloadResolution)
     : base(classTypeArguments, methodTypeArguments)
 {
     this.conversions = overloadResolution.conversions;
 }
示例#5
0
 public DynamicErasure(Conversions conversions)
 {
     this.objectType = conversions.objectType;
 }