Exemple #1
0
 public override Conversion IsValid(IType[] parameterTypes, IType returnType, Conversions conversions)
 {
     Assert.AreEqual(expectedParameterTypes, parameterTypes);
     return(conversions.ImplicitConversion(inferredReturnType, returnType));
 }
Exemple #2
0
 public override Conversion IsValid(IType[] parameterTypes, IType returnType, Conversions conversions)
 {
     return(conversions.ImplicitConversion(inferredReturnType, returnType));
 }
Exemple #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;
        }
Exemple #4
0
 public ConstraintValidatingSubstitution(IList <IType> classTypeArguments, IList <IType> methodTypeArguments, OverloadResolution overloadResolution)
     : base(classTypeArguments, methodTypeArguments)
 {
     this.conversions = overloadResolution.conversions;
 }
Exemple #5
0
 public DynamicErasure(Conversions conversions)
 {
     this.objectType = conversions.objectType;
 }