System\Dynamic\Utils\ExpressionUtils.cs (9)
142throw Error.IncorrectNumberOfConstructorArguments();
144throw Error.IncorrectNumberOfLambdaArguments();
147throw Error.IncorrectNumberOfMethodCallArguments(method, nameof(method));
172throw Error.ExpressionTypeDoesNotMatchConstructorParameter(arguments.Type, pType, argumentParamName, index);
174throw Error.ExpressionTypeDoesNotMatchParameter(arguments.Type, pType, argumentParamName, index);
177throw Error.ExpressionTypeDoesNotMatchMethodParameter(arguments.Type, pType, method, argumentParamName, index);
202throw Error.ExpressionMustBeReadable(paramName, idx);
211throw Error.ExpressionMustBeReadable(paramName, idx);
316throw Error.InvalidProgram();
System\Linq\Expressions\BinaryExpression.cs (54)
595throw Error.ExpressionTypeDoesNotMatchAssignment(right.Type, left.Type);
637throw Error.IncorrectNumberOfMethodCallArguments(method, nameof(method));
659throw Error.OperandTypesDoNotMatchParameters(binaryType, method.Name);
670throw Error.UserDefinedOpMustHaveValidReturnType(binaryType, b.Method!.Name);
692throw Error.BinaryOperatorNotDefined(binaryType, left.Type, right.Type);
703throw Error.UserDefinedOpMustHaveValidReturnType(binaryType, b.Method!.Name);
757throw Error.OperandTypesDoNotMatchParameters(exprType, name);
766throw Error.UserDefinedOperatorMustBeStatic(method, nameof(method));
768throw Error.UserDefinedOperatorMustNotBeVoid(method, nameof(method));
774throw method.IsGenericMethodDefinition ? Error.MethodIsGeneric(method, paramName) : Error.MethodContainsGenericParameters(method, paramName);
804throw Error.IncorrectNumberOfMethodCallArguments(method, nameof(method));
808throw Error.OperandTypesDoNotMatchParameters(nodeType, method.Name);
813throw Error.OperandTypesDoNotMatchParameters(nodeType, method.Name);
817throw Error.UserDefinedOpMustHaveConsistentTypes(nodeType, method.Name);
821throw Error.UserDefinedOpMustHaveConsistentTypes(nodeType, method.Name);
830throw Error.LogicalOperatorMustHaveBooleanOperators(nodeType, method.Name);
837throw Error.LogicalOperatorMustHaveBooleanOperators(nodeType, method.Name);
847throw Error.IncorrectNumberOfMethodCallArguments(opTrue, paramName);
852throw Error.OperandTypesDoNotMatchParameters(nodeType, opTrue.Name);
942_ => throw Error.UnhandledBinary(binaryType, nameof(binaryType)),
996throw Error.ReferenceEqualityNotDefined(left.Type, right.Type);
1048throw Error.ReferenceEqualityNotDefined(left.Type, right.Type);
1085throw Error.BinaryOperatorNotDefined(binaryType, left.Type, right.Type);
1291throw Error.BinaryOperatorNotDefined(ExpressionType.AndAlso, left.Type, right.Type);
1344throw Error.BinaryOperatorNotDefined(ExpressionType.OrElse, left.Type, right.Type);
1389throw Error.CoalesceUsedOnNonNullType();
1397throw Error.UserDefinedOperatorMustNotBeVoid(conversion, nameof(conversion));
1403throw Error.IncorrectNumberOfMethodCallArguments(conversion, nameof(conversion));
1411throw Error.OperandTypesDoNotMatchParameters(ExpressionType.Coalesce, conversion.ToString());
1418throw Error.OperandTypesDoNotMatchParameters(ExpressionType.Coalesce, conversion.ToString());
1428throw Error.CoalesceUsedOnNonNullType();
1444throw Error.ArgumentTypesMustMatch();
1537throw Error.ConversionIsNotSupportedForArithmeticTypes();
1555throw Error.IncorrectNumberOfMethodCallArguments(conversion, nameof(conversion));
1559throw Error.OperandTypesDoNotMatchParameters(nodeType, conversion.ToString());
1565throw Error.OverloadOperatorTypeDoesNotMatchConversionType(nodeType, conversion.ToString());
1621throw Error.ConversionIsNotSupportedForArithmeticTypes();
1751throw Error.ConversionIsNotSupportedForArithmeticTypes();
1809throw Error.ConversionIsNotSupportedForArithmeticTypes();
1939throw Error.ConversionIsNotSupportedForArithmeticTypes();
2033throw Error.ConversionIsNotSupportedForArithmeticTypes();
2127throw Error.ConversionIsNotSupportedForArithmeticTypes();
2185throw Error.ConversionIsNotSupportedForArithmeticTypes();
2332throw Error.ConversionIsNotSupportedForArithmeticTypes();
2428throw Error.ConversionIsNotSupportedForArithmeticTypes();
2523throw Error.ConversionIsNotSupportedForArithmeticTypes();
2617throw Error.ConversionIsNotSupportedForArithmeticTypes();
2711throw Error.ConversionIsNotSupportedForArithmeticTypes();
2764throw Error.BinaryOperatorNotDefined(ExpressionType.Power, left.Type, right.Type);
2825throw Error.BinaryOperatorNotDefined(ExpressionType.PowerAssign, left.Type, right.Type);
2848throw Error.ArgumentMustBeArrayIndexType(nameof(index));
2854throw Error.ArgumentMustBeArray(nameof(array));
2858throw Error.IncorrectNumberOfIndexes();
System\Linq\Expressions\BlockExpression.cs (10)
205_ => throw Error.ArgumentOutOfRange(nameof(index)),
295_ => throw Error.ArgumentOutOfRange(nameof(index)),
367_ => throw Error.ArgumentOutOfRange(nameof(index)),
409_ => throw Error.ArgumentOutOfRange(nameof(index)),
576_ => throw Error.ArgumentOutOfRange(nameof(index)),
766throw Error.ArgumentOutOfRange(nameof(index));
1037throw Error.ArgumentTypesMustMatch();
1047throw Error.ArgumentTypesMustMatch();
1078throw Error.VariableMustNotBeByRef(v, v.Type, collectionName, i);
1082throw Error.DuplicateVariable(v, collectionName, i);
System\Linq\Expressions\ExpressionVisitor.cs (7)
139throw Error.MustRewriteToSameNode(callerName, typeof(T), callerName);
162throw Error.MustRewriteToSameNode(callerName, typeof(T), callerName);
594_ => throw Error.UnhandledBindingType(node.BindingType),
645throw Error.MustRewriteWithoutMethod(after.Method, nameof(VisitUnary));
663throw Error.MustRewriteWithoutMethod(after.Method, nameof(VisitBinary));
679throw Error.MustRewriteWithoutMethod(after.Comparison, nameof(VisitSwitch));
703throw Error.MustRewriteChildToSameType(before, after, methodName);
System\Linq\Expressions\IndexExpression.cs (24)
180throw Error.ArgumentMustBeArray(nameof(array));
186throw Error.IncorrectNumberOfIndexes();
194throw Error.ArgumentMustBeArrayIndexType(nameof(indexes));
244throw Error.InstancePropertyWithoutParameterNotDefinedForType(propertyName, type);
248throw Error.InstancePropertyWithSpecifiedParametersNotDefinedForType(propertyName, GetArgTypesString(arguments), type, nameof(propertyName));
288throw Error.PropertyWithMoreThanOneMatch(propertyName, type);
384throw Error.PropertyCannotHaveRefType(paramName);
388throw Error.PropertyTypeCannotBeVoid(paramName);
397throw Error.PropertyTypeMustMatchGetter(paramName);
410throw Error.SetterHasNoParams(paramName);
417throw Error.PropertyCannotHaveRefType(paramName);
421throw Error.SetterMustBeVoid(paramName);
425throw Error.PropertyTypeMustMatchSetter(paramName);
432throw Error.BothAccessorsMustBeStatic(paramName);
436throw Error.IndexesOfSetGetMustMatch(paramName);
443throw Error.IndexesOfSetGetMustMatch(paramName);
454throw Error.PropertyDoesNotHaveAccessor(indexer, paramName);
465throw Error.AccessorsCannotHaveVarArgs(paramName);
472throw Error.OnlyStaticPropertiesHaveNullInstance(nameof(instance));
479throw Error.OnlyStaticPropertiesHaveNullInstance(nameof(instance));
495throw Error.IncorrectNumberOfMethodCallArguments(method, paramName);
505if (pType.IsByRef) throw Error.AccessorsCannotHaveByRefArgs(nameof(indexes), i);
512throw Error.ExpressionTypeDoesNotMatchMethodParameter(arg.Type, pType, method, nameof(arguments), i);
535throw Error.IncorrectNumberOfMethodCallArguments(method, paramName);
System\Linq\Expressions\LambdaExpression.cs (16)
370throw Error.ArgumentOutOfRange(nameof(index));
400_ => throw Error.ArgumentOutOfRange(nameof(index)),
452_ => throw Error.ArgumentOutOfRange(nameof(index)),
517_ => throw Error.ArgumentOutOfRange(nameof(index)),
870throw Error.DuplicateVariable(param, nameof(parameters), i);
921throw Error.LambdaTypeMustBeDerivedFromSystemDelegate(paramName);
942throw Error.IncorrectNumberOfLambdaDeclarationParameters();
956throw Error.ParameterExpressionNotValidAsDelegate(pex.Type.MakeByRefType(), pType);
962throw Error.ParameterExpressionNotValidAsDelegate(pex.Type, pType);
966throw Error.DuplicateVariable(pex, nameof(parameters), i);
972throw Error.IncorrectNumberOfLambdaDeclarationParameters();
978throw Error.ExpressionTypeDoesNotMatchReturn(body.Type, mi.ReturnType);
1034throw Error.TypeMustNotBeByRef(nameof(typeArgs));
1042throw Error.IncorrectNumberOfTypeArgsForFunc(nameof(typeArgs));
1081throw Error.TypeMustNotBeByRef(nameof(typeArgs));
1089throw Error.IncorrectNumberOfTypeArgsForAction(nameof(typeArgs));
System\Linq\Expressions\MemberExpression.cs (16)
133if (expression != null) throw Error.OnlyStaticFieldsHaveNullInstance(nameof(expression));
137if (expression == null) throw Error.OnlyStaticFieldsHaveNullInstance(nameof(field));
141throw Error.FieldInfoNotDefinedForType(field.DeclaringType, field.Name, expression.Type);
164throw Error.InstanceFieldNotDefinedForType(fieldName, expression.Type);
190throw Error.FieldNotDefinedForType(fieldName, type);
215throw Error.InstancePropertyNotDefinedForType(propertyName, expression.Type, nameof(propertyName));
239throw Error.PropertyNotDefinedForType(propertyName, type, nameof(propertyName));
262throw Error.PropertyDoesNotHaveAccessor(property, nameof(property));
266throw Error.IncorrectNumberOfMethodCallArguments(mi, nameof(property));
271throw Error.IncorrectNumberOfMethodCallArguments(mi, nameof(property));
276if (expression != null) throw Error.OnlyStaticPropertiesHaveNullInstance(nameof(expression));
280if (expression == null) throw Error.OnlyStaticPropertiesHaveNullInstance(nameof(property));
284throw Error.PropertyNotDefinedForType(property, expression.Type, nameof(property));
329throw Error.MethodNotPropertyAccessor(mi.DeclaringType, mi.Name, paramName, index);
377throw Error.NotAMemberOfType(propertyOrFieldName, expression.Type, nameof(propertyOrFieldName));
398throw Error.MemberNotFieldOrProperty(member, nameof(member));
System\Linq\Expressions\NewExpression.cs (15)
203throw Error.ArgumentCannotBeOfTypeVoid(nameof(type));
214throw Error.TypeMissingDefaultConstructor(type, nameof(type));
227throw Error.IncorrectNumberOfConstructorArguments();
231throw Error.IncorrectNumberOfArgumentsForMembers();
243throw Error.ArgumentMemberNotDeclOnType(member.Name, constructor.DeclaringType!.Name, nameof(members), i);
251throw Error.ArgumentTypeDoesNotMatchMember(arg.Type, memberType, nameof(arguments), i);
264throw Error.ExpressionTypeDoesNotMatchConstructorParameter(arg.Type, pType, nameof(arguments), i);
304throw Error.IncorrectNumberOfConstructorArguments();
308throw Error.IncorrectNumberOfMembersForGivenConstructor();
319throw Error.ArgumentMustBeInstanceMember(paramName, index);
329throw Error.PropertyDoesNotHaveGetter(pi, paramName, index);
333throw Error.ArgumentMustBeInstanceMember(paramName, index);
343throw Error.ArgumentMustBeInstanceMember(paramName, index);
351throw Error.ArgumentMustBeFieldInfoOrPropertyInfoOrMethod(paramName, index);
357throw Error.NonStaticConstructorRequired(paramName);
System\Linq\Expressions\UnaryExpression.cs (15)
341_ => throw Error.UnhandledUnary(unaryType, nameof(unaryType)),
352throw Error.UnaryOperatorNotDefined(unaryType, operand.Type);
386throw Error.IncorrectNumberOfMethodCallArguments(method, nameof(method));
400throw Error.OperandTypesDoNotMatchParameters(unaryType, method.Name);
410throw Error.CoercionOperatorNotDefined(expression.Type, convertToType);
433throw Error.IncorrectNumberOfMethodCallArguments(method, nameof(method));
447throw Error.OperandTypesDoNotMatchParameters(unaryType, method.Name);
697throw Error.IncorrectTypeForTypeAs(type, nameof(type));
715throw Error.InvalidUnboxType(nameof(expression));
717if (!type.IsValueType) throw Error.InvalidUnboxType(nameof(type));
819throw Error.ArgumentMustBeArray(nameof(array));
822throw Error.ArgumentMustBeSingleDimensionalArrayType(nameof(array));
839throw Error.QuotedExpressionMustBeLambda(nameof(expression));
887if (value.Type.IsValueType) throw Error.ArgumentMustNotHaveValueType(nameof(value));
1075throw Error.UserDefinedOpMustHaveValidReturnType(kind, method!.Name);