322 references to Error
System.Linq.Expressions (322)
System\Dynamic\CallInfo.cs (1)
55if (argCount < argNameCol.Count) throw System.Linq.Expressions.Error.ArgCntMustBeGreaterThanNameCnt();
System\Dynamic\DynamicMetaObject.cs (1)
294throw System.Linq.Expressions.Error.InvalidMetaObjectCreated(ido.GetType());
System\Dynamic\DynamicMetaObjectBinder.cs (5)
70throw System.Linq.Expressions.Error.BinderNotCompatibleWithCallSite(expectedResult, this, returnLabel.Type); 87throw System.Linq.Expressions.Error.BindingCannotBeNull(); 103throw System.Linq.Expressions.Error.DynamicObjectResultNotAssignable(body.Type, target.Value.GetType(), this, expectedResult); 107throw System.Linq.Expressions.Error.DynamicBinderResultNotAssignable(body.Type, this, expectedResult); 118throw System.Linq.Expressions.Error.DynamicBindingNeedsRestrictions(target.Value!.GetType(), this);
System\Dynamic\ExpandoObject.cs (14)
84throw System.Linq.Expressions.Error.AmbiguousMatchInExpandoObject(name); 132throw System.Linq.Expressions.Error.AmbiguousMatchInExpandoObject(name); 167throw System.Linq.Expressions.Error.SameKeyExistsInExpando(name); 199throw System.Linq.Expressions.Error.AmbiguousMatchInExpandoObject(name); 372throw System.Linq.Expressions.Error.CollectionModifiedWhileEnumerating(); 380throw System.Linq.Expressions.Error.CollectionReadOnly(); 385throw System.Linq.Expressions.Error.CollectionReadOnly(); 428throw System.Linq.Expressions.Error.CollectionReadOnly(); 511throw System.Linq.Expressions.Error.CollectionModifiedWhileEnumerating(); 519throw System.Linq.Expressions.Error.CollectionReadOnly(); 524throw System.Linq.Expressions.Error.CollectionReadOnly(); 578throw System.Linq.Expressions.Error.CollectionReadOnly(); 627throw System.Linq.Expressions.Error.KeyDoesNotExistInExpando(key); 760throw System.Linq.Expressions.Error.CollectionModifiedWhileEnumerating();
System\Dynamic\Utils\ContractUtils.cs (2)
45throw Error.InvalidArgumentValue(paramName); 92throw Error.NonEmptyCollectionRequired(paramName);
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\Dynamic\Utils\ListArgumentProvider.cs (2)
9using LinqError = System.Linq.Expressions.Error; 93throw LinqError.ArgumentOutOfRange(nameof(index));
System\Dynamic\Utils\TypeUtils.cs (4)
938throw Error.TypeMustNotBeByRef(paramName); 943throw Error.TypeMustNotBePointer(paramName); 958? Error.TypeIsGeneric(type, paramName, index) 959: Error.TypeContainsGenericParameters(type, paramName, index);
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\CatchBlock.cs (2)
145throw Error.VariableMustNotBeByRef(variable, variable.Type, nameof(variable)); 151if (filter.Type != typeof(bool)) throw Error.ArgumentMustBeBoolean(nameof(filter));
System\Linq\Expressions\Compiler\CompilerScope.cs (1)
281throw Error.UndefinedVariable(variable.Name, variable.Type, CurrentLambdaName);
System\Linq\Expressions\Compiler\LabelInfo.cs (9)
96throw Error.LabelTargetAlreadyDefined(_node!.Name); 117throw Error.AmbiguousJump(_node!.Name); 155throw Error.NonLocalJumpWithValue(_node.Name); 160throw Error.AmbiguousJump(_node!.Name); 175throw Error.ControlCannotLeaveFinally(); 179throw Error.ControlCannotLeaveFilterTest(); 195throw Error.ControlCannotEnterExpression(); 199throw Error.ControlCannotEnterTry(); 210throw Error.LabelTargetUndefined(_node!.Name);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (4)
455throw Error.UnexpectedVarArgsCall(method); 627throw Error.NonAbstractConstructorRequired(); 976throw Error.CannotAutoInitializeValueTypeMemberThroughProperty(binding.Member); 994throw Error.CannotAutoInitializeValueTypeElementThroughProperty(binding.Member);
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (2)
777throw Error.RethrowRequiresCatch(); 789throw Error.TryNotAllowedInFilter();
System\Linq\Expressions\Compiler\StackSpiller.Bindings.cs (2)
44throw Error.UnhandledBinding(); 51throw Error.CannotAutoInitializeValueTypeMemberThroughProperty(property);
System\Linq\Expressions\Compiler\StackSpiller.cs (3)
303_ => throw Error.InvalidLvalue(node.Left.NodeType), 1074throw Error.TryNotSupportedForMethodsWithRefArgs(method); 1092throw Error.TryNotSupportedForValueTypeInstances(instance.Type);
System\Linq\Expressions\Compiler\VariableBinder.cs (2)
256throw Error.UndefinedVariable(node.Name, node.Type, CurrentLambdaName); 262throw Error.CannotCloseOverByRef(node.Name, CurrentLambdaName);
System\Linq\Expressions\ConditionalExpression.cs (4)
142throw Error.ArgumentMustBeBoolean(nameof(test)); 146throw Error.ArgumentTypesMustMatch(); 174throw Error.ArgumentMustBeBoolean(nameof(test)); 182throw Error.ArgumentTypesMustMatch();
System\Linq\Expressions\ConstantExpression.cs (1)
125throw Error.ArgumentTypesMustMatch();
System\Linq\Expressions\DebugInfoExpression.cs (2)
188throw Error.StartEndMustBeOrdered(); 192throw Error.StartEndMustBeOrdered();
System\Linq\Expressions\DynamicExpression.cs (7)
868if (!delegateType.IsSubclassOf(typeof(MulticastDelegate))) throw Error.TypeMustBeDerivedFromSystemDelegate(); 895if (!delegateType.IsSubclassOf(typeof(MulticastDelegate))) throw Error.TypeMustBeDerivedFromSystemDelegate(); 925if (!delegateType.IsSubclassOf(typeof(MulticastDelegate))) throw Error.TypeMustBeDerivedFromSystemDelegate(); 958if (!delegateType.IsSubclassOf(typeof(MulticastDelegate))) throw Error.TypeMustBeDerivedFromSystemDelegate(); 994if (!delegateType.IsSubclassOf(typeof(MulticastDelegate))) throw Error.TypeMustBeDerivedFromSystemDelegate(); 1016if (pi.Length == 0 || pi[0].ParameterType != typeof(CallSite)) throw Error.FirstArgumentMustBeCallSite(); 1279if (type == typeof(void)) throw Error.ArgumentTypeCannotBeVoid();
System\Linq\Expressions\ElementInit.cs (4)
108throw Error.ElementInitializerMethodWithZeroArgs(paramName); 112throw Error.ElementInitializerMethodNotAdd(paramName); 116throw Error.ElementInitializerMethodStatic(paramName); 122throw Error.ElementInitializerMethodNoRefOutParam(pi.Name, addMethod.Name, paramName);
System\Linq\Expressions\Expression.cs (8)
96throw Error.ExtensionNodeMustOverrideProperty("Expression.NodeType"); 114throw Error.ExtensionNodeMustOverrideProperty("Expression.Type"); 132if (CanReduce) throw Error.ReducibleMustOverrideReduce(); 150if (!CanReduce) throw Error.MustBeReducible(); 185if (!CanReduce) throw Error.MustBeReducible(); 191if (newNode == null || newNode == this) throw Error.MustReduceToDifferent(); 192if (!TypeUtils.AreReferenceAssignable(Type, newNode.Type)) throw Error.ReducedNotCompatible(); 284throw Error.ExpressionMustBeWriteable(paramName);
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\GotoExpression.cs (2)
344if (target.Type != typeof(void)) throw Error.LabelMustBeVoidOrHaveExpression(nameof(target)); 368throw Error.ExpressionTypeDoesNotMatchLabel(value.Type, expectedType);
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\Interpreter\LabelInfo.cs (9)
65throw Error.LabelTargetAlreadyDefined(_node!.Name); 86throw Error.AmbiguousJump(_node!.Name); 115throw Error.NonLocalJumpWithValue(_node.Name); 120throw Error.AmbiguousJump(_node!.Name); 132throw Error.ControlCannotLeaveFinally(); 136throw Error.ControlCannotLeaveFilterTest(); 147throw Error.ControlCannotEnterExpression(); 151throw Error.ControlCannotEnterTry(); 162throw Error.LabelTargetUndefined(_node!.Name);
System\Linq\Expressions\Interpreter\LightCompiler.cs (8)
669throw Error.InvalidProgram(); 695throw Error.NotSupported(); 749throw Error.InvalidLvalue(node.Left.NodeType); 1929throw Error.RethrowRequiresCatch(); 2390throw Error.NonAbstractConstructorRequired(); 2458throw Error.InvalidProgram(); 2489throw Error.InvalidProgram(); 2748throw Error.CannotAutoInitializeValueTypeMemberThroughProperty(memberMember.Bindings);
System\Linq\Expressions\InvocationExpression.cs (1)
751throw Error.ExpressionTypeNotInvocable(expression.Type, nameof(expression));
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\LoopExpression.cs (1)
110if (@continue != null && @continue.Type != typeof(void)) throw Error.LabelTypeMustBeVoid(nameof(@continue));
System\Linq\Expressions\MemberAssignment.cs (4)
67throw Error.ArgumentTypesMustMatch(); 92throw Error.NotAMemberOfAnyType(member, nameof(member)); 102throw Error.PropertyDoesNotHaveSetter(pi, nameof(member)); 113throw Error.ArgumentMustBeFieldInfoOrPropertyInfo(nameof(member));
System\Linq\Expressions\MemberBinding.cs (1)
63internal virtual void ValidateAsDefinedHere(int index) => throw Error.UnknownBindingType(index);
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\MemberListBinding.cs (1)
125throw Error.TypeNotIEnumerable(listType, listTypeParamName);
System\Linq\Expressions\MemberMemberBinding.cs (4)
128throw Error.NotAMemberOfAnyType(member, nameof(member)); 138throw Error.PropertyDoesNotHaveGetter(pi, nameof(member)); 149throw Error.ArgumentMustBeFieldInfoOrPropertyInfo(nameof(member)); 162throw Error.NotAMemberOfType(b.Member.Name, type, nameof(bindings), i);
System\Linq\Expressions\MethodCallExpression.cs (9)
1251if (instance != null) throw Error.OnlyStaticMethodsHaveNullInstance(); 1255if (instance == null) throw Error.OnlyStaticMethodsHaveNullInstance(); 1265throw Error.InstanceAndMethodTypeMismatch(method, method.DeclaringType, instanceType); 1333throw Error.GenericMethodWithArgsDoesNotExistOnType(methodName, type); 1337throw Error.MethodWithArgsDoesNotExistOnType(methodName, type); 1342throw Error.MethodWithMoreThanOneMatch(methodName, type); 1417throw Error.ArgumentMustBeArray(nameof(array)); 1423throw Error.IncorrectNumberOfIndexes(); 1433throw Error.ArgumentMustBeArrayIndexType(nameof(indexes), i);
System\Linq\Expressions\NewArrayExpression.cs (5)
141throw Error.ArgumentCannotBeOfTypeVoid(nameof(type)); 157throw Error.ExpressionTypeCannotInitializeArrayType(expr.Type, type); 218throw Error.ArgumentCannotBeOfTypeVoid(nameof(type)); 226if (dimensions <= 0) throw Error.BoundsCannotBeLessThanOne(nameof(bounds)); 234throw Error.ArgumentMustBeInteger(nameof(bounds), i);
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\ParameterExpression.cs (1)
207throw Error.ArgumentCannotBeOfTypeVoid(nameof(type));
System\Linq\Expressions\SwitchExpression.cs (10)
180if (switchValue.Type == typeof(void)) throw Error.ArgumentCannotBeOfTypeVoid(nameof(switchValue)); 203throw Error.IncorrectNumberOfMethodCallArguments(comparison, nameof(comparison)); 214throw Error.SwitchValueTypeDoesNotMatchComparisonMethodParameter(switchValue.Type, leftParam.ParameterType); 232throw Error.TestValueTypeDoesNotMatchComparisonMethodParameter(rightOperandType, rightParam.ParameterType); 238throw Error.TestValueTypeDoesNotMatchComparisonMethodParameter(rightOperandType, rightParam.ParameterType); 246throw Error.EqualityMustReturnBoolean(comparison, nameof(comparison)); 263throw Error.AllTestValuesMustHaveSameType(nameof(cases)); 279if (resultType != typeof(void)) throw Error.DefaultBodyMustBeSupplied(nameof(defaultBody)); 302throw Error.ArgumentTypesMustMatch(parameterName); 310throw Error.AllCaseBodiesMustHaveSameType(parameterName);
System\Linq\Expressions\TryExpression.cs (6)
165throw Error.FaultCannotHaveCatchOrFinally(nameof(fault)); 175throw Error.TryMustHaveCatchFinallyOrFault(); 192throw Error.ArgumentTypesMustMatch(); 198throw Error.ArgumentTypesMustMatch(); 211throw Error.BodyOfCatchMustHaveSameTypeAsBodyOfTry(); 224throw Error.BodyOfCatchMustHaveSameTypeAsBodyOfTry();
System\Linq\Expressions\TypeBinaryExpression.cs (2)
195if (type.IsByRef) throw Error.TypeMustNotBeByRef(nameof(type)); 210if (type.IsByRef) throw Error.TypeMustNotBeByRef(nameof(type));
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);
System\Runtime\CompilerServices\CallSite.cs (2)
91if (!delegateType.IsSubclassOf(typeof(MulticastDelegate))) throw System.Linq.Expressions.Error.TypeMustBeDerivedFromSystemDelegate(); 217if (!typeof(T).IsSubclassOf(typeof(MulticastDelegate))) throw System.Linq.Expressions.Error.TypeMustBeDerivedFromSystemDelegate();
System\Runtime\CompilerServices\CallSiteBinder.cs (3)
55throw System.Linq.Expressions.Error.TypeParameterIsNotDelegate(target); 62throw System.Linq.Expressions.Error.FirstArgumentMustBeCallSite(); 127throw System.Linq.Expressions.Error.NoOrInvalidRuleProduced();
System\Runtime\CompilerServices\ReadOnlyCollectionBuilder.cs (7)
280throw Error.InvalidTypeException(value, typeof(T), nameof(value)); 312throw Error.InvalidTypeException(value, typeof(T), nameof(value)); 342throw Error.InvalidTypeException(value, typeof(T), nameof(value)); 456throw Error.InvalidNullValue(typeof(T), argument); 498throw Error.EnumerationIsDone(); 522throw Error.CollectionModifiedWhileEnumerating(); 534throw Error.CollectionModifiedWhileEnumerating();