358 references to Add
Microsoft.CodeAnalysis.CSharp (358)
Binder\Binder.ValueChecks.cs (2)
850diagnostics.Add(ErrorCode.ERR_RefLocalOrParamExpected, node.Location); 4290diagnostics.Add(ErrorCode.ERR_InternalError, node.Location);
Binder\Binder_AnonymousTypes.cs (1)
59diagnostics.Add(ErrorCode.ERR_InvalidAnonymousTypeMemberDeclarator, expression.GetLocation());
Binder\Binder_Attributes.cs (2)
462diagnostics.Add(ErrorCode.ERR_NamedArgumentExpected, argument.Expression.GetLocation()); 735diagnostics.Add(ErrorCode.ERR_BadAttributeArgument, syntax.Location);
Binder\Binder_Constraints.cs (6)
201diagnostics.Add(ErrorCode.ERR_NewBoundWithVal, syntax.GetFirstToken().GetLocation()); 205diagnostics.Add(ErrorCode.ERR_NewBoundWithUnmanaged, syntax.GetFirstToken().GetLocation()); 210diagnostics.Add(ErrorCode.ERR_NewBoundMustBeLast, syntax.GetFirstToken().GetLocation()); 220diagnostics.Add(ErrorCode.ERR_DefaultConstraintOverrideOnly, syntax.GetLocation()); 312diagnostics.Add(ErrorCode.ERR_OverrideWithConstraints, syntax.GetLocation()); 319diagnostics.Add(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, syntax.GetLocation());
Binder\Binder_Crefs.cs (2)
543diagnostics.Add(ErrorCode.WRN_UnqualifiedNestedTypeInCref, parameterListSyntax.Parameters[i].Location); 979diagnostics.Add(ErrorCode.WRN_BadXMLRefReturnType, typeSyntax.Location);
Binder\Binder_Deconstruct.cs (4)
824diagnostics.Add(ErrorCode.ERR_ScopedDiscard, scopedType.ScopedKeyword.GetLocation()); 830diagnostics.Add(ErrorCode.ERR_DeconstructVariableCannotBeByRef, refType.RefKeyword.GetLocation()); 888diagnostics.Add(ErrorCode.ERR_DeconstructVariableCannotBeByRef, refType.RefKeyword.GetLocation()); 899diagnostics.Add(ErrorCode.ERR_ScopedRefAndRefStructOnly, typeSyntax.Location);
Binder\Binder_Expressions.cs (25)
294diagnostics.Add(ErrorCode.ERR_SwitchExpressionNoBestType, exprSyntax.SwitchKeyword.GetLocation()); 350diagnostics.Add(ErrorCode.ERR_DefaultLiteralNoTargetType, defaultExpr.Syntax.GetLocation()); 410diagnostics.Add(ErrorCode.ERR_CannotInferDelegateType, syntax.GetLocation()); 801diagnostics.Add(ErrorCode.ERR_InternalError, node.Location); 843diagnostics.Add(ErrorCode.ERR_ThrowMisplaced, node.ThrowKeyword.GetLocation()); 1003diagnostics.Add(ErrorCode.ERR_VoidInTuple, argumentSyntax.Location); 1346diagnostics.Add(ErrorCode.ERR_BadDynamicTypeof, node.Location); 1352diagnostics.Add(ErrorCode.ERR_BadNullableTypeof, node.Location); 2899diagnostics.Add(ErrorCode.ERR_ScopedDiscard, scopedType.ScopedKeyword.GetLocation()); 2905diagnostics.Add(ErrorCode.ERR_OutVariableCannotBeByRef, refType.Location); 2947diagnostics.Add(ErrorCode.ERR_OutVariableCannotBeByRef, refType.Location); 2972diagnostics.Add(ErrorCode.ERR_ScopedRefAndRefStructOnly, typeSyntax.Location); 4218diagnostics.Add(ErrorCode.ERR_NoDynamicPhantomOnBaseCtor, errorLocation); 4330diagnostics.Add(ErrorCode.ERR_ChainingToSetsRequiredMembersRequiresSetsRequiredMembers, errorLocation); 4380diagnostics.Add(ErrorCode.ERR_CopyConstructorMustInvokeBaseCopyConstructor, errorLocation); 4389diagnostics.Add(ErrorCode.ERR_CopyConstructorMustInvokeBaseCopyConstructor, errorLocation); 4437diagnostics.Add(ErrorCode.ERR_AnnotationDisallowedInObjectCreation, node.Location); 4472diagnostics.Add(ErrorCode.ERR_InvalidObjectCreation, node.Type.Location)); 4514diagnostics.Add(ErrorCode.ERR_MethodNameExpected, loc); 4590diagnostics.Add(ErrorCode.ERR_MethodNameExpected, argument.Syntax.Location); 4651diagnostics.Add(ErrorCode.ERR_MethodNameExpected, argument.Syntax.Location); 4677diagnostics.Add(ErrorCode.ERR_NewWithTupleTypeSyntax, node.Type.GetLocation()); 5060diagnostics.Add(ErrorCode.ERR_InterpolatedStringsReferencingInstanceCannotBeInObjectInitializers, argument.Syntax.Location); 7528diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportRefFields, node.Location); 8586diagnostics.Add(
Binder\Binder_InterpolatedString.cs (3)
117diagnostics.Add(ErrorCode.ERR_ConstantExpected, interpolation.AlignmentClause.Value.Location); 128diagnostics.Add(ErrorCode.ERR_EmptyFormatSpecifier, interpolation.FormatClause.Location); 133diagnostics.Add(ErrorCode.ERR_TrailingWhitespaceInFormatSpecifier, interpolation.FormatClause.Location);
Binder\Binder_Invocation.cs (5)
1359diagnostics.Add(ErrorCode.ERR_BadAttributeArgument, syntax.Location); 1897diagnostics.Add(ErrorCode.ERR_NameofMethodGroupWithTypeParameters, argument.Location); 1923diagnostics.Add(ErrorCode.ERR_NameofExtensionMethod, methodGroup.Syntax.Location); 1968diagnostics.Add(ErrorCode.ERR_AliasQualifiedNameNotAnExpression, argument.Location); 1983diagnostics.Add(code, argument.Location);
Binder\Binder_Lambda.cs (2)
290diagnostics.Add(ErrorCode.ERR_LambdaExplicitReturnTypeVar, syntax.Location); 329diagnostics.Add(ErrorCode.ERR_InconsistentLambdaParameterUsage,
Binder\Binder_Operators.cs (3)
4203diagnostics.Add(ErrorCode.ERR_RefConditionalNeedsTwoRefs, whenFalse.GetFirstToken().GetLocation()); 4208diagnostics.Add(ErrorCode.ERR_RefConditionalNeedsTwoRefs, whenTrue.GetFirstToken().GetLocation()); 4319diagnostics.Add(_inUnsafeRegion ? ErrorCode.WRN_MismatchedRefEscapeInTernary : ErrorCode.ERR_MismatchedRefEscapeInTernary, node.Location);
Binder\Binder_Patterns.cs (16)
103diagnostics.Add(ErrorCode.WRN_GivenExpressionNeverMatchesPattern, node.Location); 110diagnostics.Add(ErrorCode.WRN_GivenExpressionAlwaysMatchesConstant, node.Location); 117diagnostics.Add(ErrorCode.WRN_GivenExpressionAlwaysMatchesPattern, node.Location); 211diagnostics.Add(ErrorCode.ERR_MisplacedSlicePattern, node.Location); 476diagnostics.Add(ErrorCode.ERR_DefaultPattern, e.Location); 483diagnostics.Add(ErrorCode.ERR_IllegalSuppression, e.Location); 560diagnostics.Add(ErrorCode.ERR_ConstantExpected, patternExpression.Location); 728diagnostics.Add(ErrorCode.ERR_PointerTypeInPatternMatching, typeSyntax.Location); 873diagnostics.Add(ErrorCode.ERR_DesignatorBeneathPatternCombinator, identifier.GetLocation()); 958diagnostics.Add(ErrorCode.ERR_PointerTypeInPatternMatching, node.Location); 1084diagnostics.Add(ErrorCode.ERR_IdentifierExpected, subPattern.ExpressionColon.Expression.Location); 1111diagnostics.Add(ErrorCode.ERR_ArgumentNameInITuplePattern, subpatternSyntax.NameColon.Location); 1115diagnostics.Add(ErrorCode.ERR_IdentifierExpected, subpatternSyntax.ExpressionColon.Expression.Location); 1174diagnostics.Add(ErrorCode.ERR_IdentifierExpected, subpatternSyntax.ExpressionColon.Expression.Location); 1317diagnostics.Add(ErrorCode.ERR_PointerTypeInPatternMatching, node.Location); 1639diagnostics.Add(ErrorCode.ERR_RelationalPatternWithNaN, node.Expression.Location);
Binder\Binder_Query.cs (5)
35diagnostics.Add(ErrorCode.ERR_BadDynamicQuery, fromClause.Expression.Location); 386diagnostics.Add(ErrorCode.ERR_BadDynamicQuery, join.InExpression.Location); 936diagnostics.Add(ErrorCode.ERR_NullNotValid, node.Location); 940diagnostics.Add(ErrorCode.ERR_DefaultLiteralNotValid, node.Location); 944diagnostics.Add(ErrorCode.ERR_ImplicitObjectCreationNotValid, node.Location);
Binder\Binder_Statements.cs (14)
324diagnostics.Add(ErrorCode.ERR_BadEmbeddedStmt, node.GetLocation()); 342diagnostics.Add(ErrorCode.ERR_BadEmbeddedStmt, node.GetLocation()); 377diagnostics.Add(ErrorCode.WRN_PossibleMistakenNullStatement, node.GetLocation()); 412diagnostics.Add(ErrorCode.ERR_BadExceptionType, exprSyntax.Location); 443diagnostics.Add(ErrorCode.ERR_BadEmptyThrow, node.ThrowKeyword.GetLocation()); 454diagnostics.Add(ErrorCode.ERR_BadEmptyThrowInFinally, node.ThrowKeyword.GetLocation()); 1104localDiagnostics.Add(ErrorCode.ERR_ScopedRefAndRefStructOnly, typeSyntax.Location); 1476diagnostics.Add(ErrorCode.ERR_VoidAssignment, op1.Syntax.Location); 2191diagnostics.Add(ErrorCode.ERR_InternalError, syntax.Location); 2912diagnostics.Add(ErrorCode.ERR_ReturnInIterator, syntax.ReturnKeyword.GetLocation()); 2920diagnostics.Add(ErrorCode.ERR_MustNotHaveRefReturn, syntax.ReturnKeyword.GetLocation()); 2925diagnostics.Add(ErrorCode.ERR_ReturnInIterator, syntax.ReturnKeyword.GetLocation()); 2934diagnostics.Add(errorCode, syntax.ReturnKeyword.GetLocation()); 3124diagnostics.Add(ErrorCode.ERR_TooManyCatches, catchSyntax.CatchKeyword.GetLocation());
Binder\Binder_Symbols.cs (4)
487diagnostics.Add(ErrorCode.ERR_BadRefInUsingAlias, refToken.GetLocation()); 604diagnostics.Add(ErrorCode.ERR_TypeExpected, syntax.GetLocation()); 1219diagnostics.Add(ErrorCode.ERR_UnexpectedUnboundGenericName, node.Location); 2567return diagnostics.Add(code, location);
Binder\Binder_WithExpression.cs (1)
25diagnostics.Add(ErrorCode.ERR_InvalidWithReceiverType, syntax.Expression.Location);
Binder\EarlyWellKnownAttributeBinder.cs (1)
49diagnostics.Add(ErrorCode.ERR_InternalError, node.Location);
Binder\ExecutableCodeBinder.cs (4)
114diagnostics.Add(ErrorCode.ERR_BadIteratorArgType, parameter.Locations[0]); 118diagnostics.Add(ErrorCode.ERR_UnsafeIteratorArgType, parameter.Locations[0]); 126diagnostics.Add(ErrorCode.ERR_VarargsIterator, errorLocation); 132diagnostics.Add(ErrorCode.ERR_IllegalInnerUnsafe, errorLocation);
Binder\ForEachLoopBinder.cs (3)
305diagnostics.Add(ErrorCode.ERR_ScopedRefAndRefStructOnly, typeSyntax.Location); 772diagnostics.Add(ErrorCode.ERR_BadDynamicAwaitForEach, _syntax.Expression.Location); 1004diagnostics.Add(ErrorCode.ERR_NullNotValid, _syntax.Expression.Location);
Binder\InMethodBinder.cs (1)
318diagnostics.Add(ErrorCode.ERR_InternalError, newLocation);
Binder\LocalScopeBinder.cs (1)
491diagnostics.Add(ErrorCode.ERR_InternalError, newLocation);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (2)
478diagnostics.Add(ErrorCode.ERR_FunctionPointersCannotBeCalledWithNamedArguments, badName); 1192diagnostics.Add(ErrorCode.ERR_MissingAddressOf, sourceLocation);
Binder\SwitchBinder.cs (2)
424diagnostics.Add(ErrorCode.ERR_V6SwitchGoverningTypeValueExpected, node.Location); 503diagnostics.Add(ErrorCode.ERR_ConstantExpected, node.Location);
Binder\SwitchBinder_Patterns.cs (5)
35diagnostics.Add(ErrorCode.WRN_EmptySwitch, node.OpenBraceToken.GetLocation()); 105diagnostics.Add(ErrorCode.ERR_SwitchCaseSubsumed, p.Pattern.Location); 116diagnostics.Add(ErrorCode.ERR_SwitchCaseSubsumed, p.Value.Location); 206diagnostics.Add(ErrorCode.ERR_UsingVarInSwitchCase, statement.Location); 290diagnostics.Add(ErrorCode.WRN_CaseConstantNamedUnderscore, expression.Location);
Binder\SwitchExpressionBinder.cs (1)
70diagnostics.Add(ErrorCode.ERR_SwitchArmSubsumed, arm.Pattern.Syntax.Location);
Binder\WithLambdaParametersBinder.cs (2)
82diagnostics.Add(ErrorCode.ERR_YieldInAnonMeth, node.YieldKeyword.GetLocation()); 154diagnostics.Add(ErrorCode.ERR_InternalError, newLocation);
BoundTree\BoundTreeVisitors.cs (1)
180diagnostics.Add(ErrorCode.ERR_InsufficientStack, GetTooLongOrComplexExpressionErrorLocation(Node));
BoundTree\VariablePendingInference.cs (1)
69diagnosticsOpt.Add(ErrorCode.ERR_ScopedRefAndRefStructOnly,
CodeGen\EmitExpression.cs (1)
87_diagnostics.Add(ErrorCode.ERR_InsufficientStack,
CodeGen\EmitStatement.cs (1)
387_diagnostics.Add(ErrorCode.ERR_InsufficientStack,
Compilation\CSharpCompilation.cs (5)
1700diagnostics.Add(ErrorCode.ERR_SimpleProgramNotAnExecutable, simpleProgramEntryPointSymbol.ReturnTypeSyntax.Location); 1855diagnostics.Add(ErrorCode.ERR_NonTaskMainCantBeAsync, candidate.Locations.First()); 1930diagnostics.Add(ErrorCode.ERR_NoEntryPoint, NoLocation.Singleton); 1945diagnostics.Add(ErrorCode.ERR_EntryPointCannotBeUnmanagedCallersOnly, viableEntryPoint.Locations.First()); 2405diagnostics.Add(code, infoTree.GetLocation(infoSpan));
Compiler\MethodCompiler.cs (1)
1627diagnosticsForThisMethod.Add(ErrorCode.ERR_TooManyLocals, method.Locations.First());
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (1)
367F.Diagnostics.Add(ErrorCode.ERR_BadAsyncReturn, F.Syntax.Location);
Lowering\AsyncRewriter\AsyncRewriter.cs (1)
65diagnostics.Add(containsAwait ? ErrorCode.ERR_PossibleAsyncIteratorWithoutYield : ErrorCode.ERR_PossibleAsyncIteratorWithoutYieldOrAwait,
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
534_diagnostics.Add(ErrorCode.ERR_ByRefParameterInExpressionTree, p.Locations[0]); 543_diagnostics.Add(ErrorCode.ERR_LambdaWithAttributesToExpressionTree, p.Locations[0]);
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
642_factory.Diagnostics.Add(ErrorCode.ERR_DynamicRequiredTypesMissing, NoLocation.Singleton);
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
626F.Diagnostics.Add(ErrorCode.ERR_RefConditionalAndAwait, F.Syntax.Location);
Symbols\AliasSymbol.cs (1)
417diagnostics.Add(ErrorCode.ERR_BadNullableReferenceTypeInUsingAlias, nullableType.QuestionToken.GetLocation());
Symbols\Attributes\AttributeData.cs (2)
268((BindingDiagnosticBag)arguments.Diagnostics).Add(ErrorCode.ERR_IllegalUnsafe, arguments.AttributeSyntaxOpt.Location); 397diagnostics.Add(ErrorCode.ERR_SecurityAttributeMissingAction, nodeOpt != null ? nodeOpt.Name.Location : NoLocation.Singleton);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (3)
75diagnostics.Add(ErrorCode.ERR_NoVoidHere, returnTypeParameter.Location); 119diagnostics.Add(ErrorCode.ERR_CannotSpecifyManagedWithUnmanagedSpecifiers, callingConventionSyntax.UnmanagedCallingConventionList.GetLocation()); 233diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportUnmanagedDefaultCallConv, errorLocation);
Symbols\MethodSymbol.cs (2)
1033diagnostics?.Add(ErrorCode.ERR_UnmanagedCallersOnlyRequiresStatic, location!); 1039diagnostics?.Add(ErrorCode.ERR_UnmanagedCallersOnlyMethodOrTypeCannotBeGeneric, location!);
Symbols\Source\ExplicitInterfaceHelpers.cs (2)
227diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, location); 370diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, implementingMember.Locations[0]);
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (5)
184diagnostics.Add(ErrorCode.ERR_StructOffsetOnBadField, arguments.AttributeSyntaxOpt.Name.Location); 280diagnostics.Add(ErrorCode.ERR_FieldHasMultipleDistinctConstantValues, arguments.AttributeSyntaxOpt.Location); 285diagnostics.Add(ErrorCode.ERR_FieldHasMultipleDistinctConstantValues, arguments.AttributeSyntaxOpt.Location); 301diagnostics.Add(ErrorCode.ERR_FieldHasMultipleDistinctConstantValues, arguments.AttributeSyntaxOpt.Location); 332diagnostics.Add(ErrorCode.ERR_StructOffsetOnBadStruct, allAttributeSyntaxNodes[i].Name.Location);
Symbols\Source\LambdaSymbol.cs (1)
290addTo.Add(ErrorCode.ERR_BuilderAttributeDisallowed, DiagnosticLocation);
Symbols\Source\LocalFunctionSymbol.cs (3)
68_declarationDiagnostics.Add(ErrorCode.ERR_BadExtensionAgg, Locations[0]); 184diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, arglistToken.GetLocation()); 382diagnostics.Add(ErrorCode.ERR_IllegalVarianceSyntax, parameter.VarianceKeyword.GetLocation());
Symbols\Source\ModifierUtils.cs (4)
137diagnostics.Add(ErrorCode.ERR_PartialMisplaced, partialToken.GetLocation()); 142diagnostics.Add(ErrorCode.ERR_PartialMisplaced, errorLocation); 466diagnostics.Add(ErrorCode.ERR_BadMemberProtection, errorLocation); 482diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportProtectedAccessForInterfaceMember, errorLocation);
Symbols\Source\ParameterHelpers.cs (18)
98diagnostics.Add(ErrorCode.ERR_NoVoidParameter, syntax.Type.Location); 145diagnostics.Add(ErrorCode.ERR_ThisInBadContext, thisKeyword.GetLocation()); 160diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, arglistToken.GetLocation()); 166diagnostics.Add(ErrorCode.ERR_VarargsLast, concreteParam.GetLocation()); 186diagnostics.Add(ErrorCode.ERR_IllegalRefParam, refnessKeyword.GetLocation()); 427diagnostics.Add(ErrorCode.ERR_ThisInBadContext, modifier.GetLocation()); 439diagnostics.Add(ErrorCode.ERR_BadParamModThis, modifier.GetLocation()); 505diagnostics.Add(ErrorCode.ERR_IllegalParams, modifier.GetLocation()); 513diagnostics.Add(ErrorCode.ERR_BadParamModThis, modifier.GetLocation()); 579diagnostics.Add(ErrorCode.ERR_ReadOnlyNotSuppAsParamModDidYouMeanIn, modifier.GetLocation()); 637diagnostics.Add(ErrorCode.ERR_IllegalParams, paramsKeyword.GetLocation()); 642diagnostics.Add(ErrorCode.ERR_ParamsMustBeArray, paramsKeyword.GetLocation()); 657diagnostics.Add(ErrorCode.ERR_DefaultValueBeforeRequiredValue, loc); 669diagnostics.Add(ErrorCode.ERR_ParamsLast, syntax.GetLocation()); 674diagnostics.Add(ErrorCode.ERR_ScopedRefAndRefStructOnly, syntax.Location); 722diagnostics.Add(ErrorCode.ERR_RefOutDefaultValue, refnessKeyword.GetLocation()); 728diagnostics.Add(ErrorCode.ERR_DefaultValueForParamsParameter, paramsKeyword.GetLocation()); 738diagnostics.Add(ErrorCode.ERR_DefaultValueForExtensionParameter, thisKeyword.GetLocation());
Symbols\Source\SourceAssemblySymbol.cs (10)
594diagnostics.Add(ErrorCode.WRN_DelaySignButNoKey, NoLocation.Singleton); 601diagnostics.Add(ErrorCode.ERR_PublicSignNetModule, NoLocation.Singleton); 605diagnostics.Add(ErrorCode.ERR_PublicSignButNoKey, NoLocation.Singleton); 2187diagnostics.Add(ErrorCode.ERR_InvalidFwdType, GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt)); 2218diagnostics.Add(ErrorCode.ERR_InvalidFwdType, GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt)); 2256diagnostics.Add(ErrorCode.ERR_CannotPassNullForFriendAssembly, GetAssemblyAttributeLocationForDiagnostic(nodeOpt)); 2356diagnostics.Add(ErrorCode.ERR_InvalidSignaturePublicKey, attribute.GetAttributeArgumentSyntaxLocation(0, arguments.AttributeSyntaxOpt)); 2411diagnostics.Add(ErrorCode.ERR_InvalidAssemblyCultureForExe, attribute.GetAttributeArgumentSyntaxLocation(0, arguments.AttributeSyntaxOpt)); 2415diagnostics.Add(ErrorCode.ERR_InvalidAssemblyCulture, attribute.GetAttributeArgumentSyntaxLocation(0, arguments.AttributeSyntaxOpt)); 2527diagnostics.Add(ErrorCode.ERR_ExplicitExtension, arguments.AttributeSyntaxOpt.Location);
Symbols\Source\SourceComplexParameterSymbol.cs (19)
758diagnostics.Add(ErrorCode.ERR_DefaultValueUsedWithAttributes, arguments.AttributeSyntaxOpt.Name.Location); 764diagnostics.Add(ErrorCode.ERR_ExplicitParamArray, arguments.AttributeSyntaxOpt.Name.Location); 858diagnostics.Add(ErrorCode.ERR_UnscopedRefAttributeUnsupportedTarget, arguments.AttributeSyntaxOpt.Location); 862diagnostics.Add(ErrorCode.ERR_UnscopedScoped, arguments.AttributeSyntaxOpt.Location); 911diagnostics.Add(ErrorCode.ERR_ParamDefaultValueDiffersFromAttribute, syntax.Location); 944diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueUsedWithAttributes, node.Name.Location); 982diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueTypeMustMatch, node.Name.Location); 1002diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueTypeMustMatch, node.Name.Location); 1070diagnostics.Add(ErrorCode.ERR_BadCallerLineNumberParamWithoutDefaultValue, node.Name.Location); 1098diagnostics.Add(ErrorCode.ERR_BadCallerFilePathParamWithoutDefaultValue, node.Name.Location); 1131diagnostics.Add(ErrorCode.ERR_BadCallerMemberNameParamWithoutDefaultValue, node.Name.Location); 1172diagnostics.Add(ErrorCode.ERR_BadCallerArgumentExpressionParamWithoutDefaultValue, node.Name.Location); 1249diagnostics.Add(ErrorCode.WRN_InterpolatedStringHandlerArgumentAttributeIgnoredOnLambdaParameters, errorLocation); 1277diagnostics.Add(ErrorCode.ERR_NullInvalidInterpolatedStringHandlerArgumentName, arguments.AttributeSyntaxOpt!.Location); 1321diagnostics.Add(ErrorCode.ERR_NullInvalidInterpolatedStringHandlerArgumentName, arguments.AttributeSyntaxOpt.Location); 1357diagnostics.Add(ErrorCode.ERR_CannotUseSelfAsInterpolatedStringHandlerArgument, errorLocation); 1397diagnostics.Add(ErrorCode.ERR_OutAttrOnRefParam, this.Locations[0]); 1404diagnostics.Add(ErrorCode.ERR_InAttrOnOutParam, this.Locations[0]); 1411diagnostics.Add(ErrorCode.ERR_OutAttrOnInParam, this.Locations[0]);
Symbols\Source\SourceConstructorSymbol.cs (2)
50diagnostics.Add(ErrorCode.ERR_MemberNeedsType, location); 157diagnostics.Add(ErrorCode.ERR_ConstructorInStaticClass, location);
Symbols\Source\SourceConstructorSymbolBase.cs (1)
77diagnostics.Add(ErrorCode.ERR_BadVarargs, location);
Symbols\Source\SourceCustomEventAccessorSymbol.cs (1)
54diagnostics.Add(ErrorCode.ERR_NoModifiersOnAccessor, syntax.Modifiers[0].GetLocation());
Symbols\Source\SourceCustomEventSymbol.cs (6)
95diagnostics.Add(ErrorCode.ERR_DuplicateAccessor, accessor.Keyword.GetLocation()); 106diagnostics.Add(ErrorCode.ERR_DuplicateAccessor, accessor.Keyword.GetLocation()); 112diagnostics.Add(ErrorCode.ERR_AddOrRemoveExpected, accessor.Keyword.GetLocation()); 126diagnostics.Add(ErrorCode.ERR_AddRemoveMustHaveBody, accessor.SemicolonToken.GetLocation()); 144diagnostics.Add(ErrorCode.ERR_ExplicitEventFieldImpl, this.Locations[0]); 155diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportDefaultInterfaceImplementation, this.Locations[0]);
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
288diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, new SourceLocation(arglistToken));
Symbols\Source\SourceDestructorSymbol.cs (3)
35diagnostics.Add(ErrorCode.ERR_BadDestructorName, syntax.Identifier.GetLocation()); 58diagnostics.Add(ErrorCode.ERR_DestructorInStaticClass, location); 62diagnostics.Add(ErrorCode.ERR_OnlyClassesCanContainDestructors, location);
Symbols\Source\SourceEventSymbol.cs (1)
312diagnostics.Add(ErrorCode.ERR_UnscopedRefAttributeUnsupportedMemberTarget, arguments.AttributeSyntaxOpt!.Location);
Symbols\Source\SourceFieldLikeEventSymbol.cs (3)
91diagnostics.Add(ErrorCode.ERR_FieldlikeEventsInRoStruct, this.Locations[0]); 100diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, this.Locations[0]); 107diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportDefaultInterfaceImplementation, this.Locations[0]);
Symbols\Source\SourceFieldSymbol.cs (2)
69diagnostics.Add(ErrorCode.ERR_FieldsInRoStruct, ErrorLocation); 125((BindingDiagnosticBag)arguments.Diagnostics).Add(ErrorCode.ERR_DoNotUseFixedBufferAttr, arguments.AttributeSyntaxOpt.Name.Location);
Symbols\Source\SourceFixedFieldSymbol.cs (2)
80diagnostics.Add(ErrorCode.ERR_FixedBufferTooManyDimensions, declarator.ArgumentList.Location); 120diagnostics.Add(ErrorCode.ERR_InvalidFixedArraySize, sizeExpression.Location);
Symbols\Source\SourceMemberContainerSymbol.cs (24)
1837diagnostics.Add(ErrorCode.ERR_CloneDisallowedInRecord, member.Locations[0]); 2147diagnostics.Add(ErrorCode.ERR_InconsistentIndexerNames, indexer.Locations[0]); 2547diagnostics.Add(ErrorCode.ERR_ScriptsAndSubmissionsCannotHaveRequiredMembers, member.Locations[0]); 3427diagnostics.Add(ErrorCode.ERR_ConstructorInStaticClass, syntax.Identifier.GetLocation()); 3441diagnostics.Add(ErrorCode.ERR_MultipleRecordParameterLists, parameterList.Location); 3481diagnostics.Add(ErrorCode.ERR_PartialMethodOnlyOneActual, methodPart.Locations[0]); 3487diagnostics.Add(ErrorCode.ERR_PartialMethodOnlyOneLatent, methodPart.Locations[0]); 3794diagnostics.Add(ErrorCode.ERR_InterfacesCantContainConstructors, member.Locations[0]); 3801diagnostics.Add(ErrorCode.ERR_OnlyClassesCanContainDestructors, member.Locations[0]); 3844diagnostics.Add(ErrorCode.ERR_EnumsCantContainDefaultConstructor, location); 3851diagnostics.Add(ErrorCode.ERR_NonPublicParameterlessStructConstructor, location); 3883diagnostics.Add(ErrorCode.ERR_StructHasInitializersAndNoDeclaredConstructor, Locations[0]); 4093diagnostics.Add(ErrorCode.ERR_RecordAmbigCtor, copyCtor.Locations[0]); 4654diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected, 4698diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected, 4712diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected, 4731diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected, 4749diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected, 4800diagnostics.Add( 4854diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected, 4874diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected, 4891diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected, 4906diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected, 4967diagnostics.Add(ErrorCode.ERR_GlobalStatement, new SourceLocation(globalStatement));
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (3)
970(diagnostics, overriddenEvent, overridingEvent, location) => diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInTypeOnOverride, location), 1022diagnostics.Add(ErrorCode.ERR_OverrideFinalizeDeprecated, overridingMemberLocation); 1219=> diagnostics.Add(topLevel ?
Symbols\Source\SourceMemberFieldSymbol.cs (13)
60diagnostics.Add(ErrorCode.ERR_FieldCantHaveVoidType, TypeSyntax?.Location ?? this.Locations[0]); 190diagnostics.Add(ErrorCode.ERR_AbstractField, errorLocation); 360diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportDefaultInterfaceImplementation, ErrorLocation); 365diagnostics.Add(ErrorCode.ERR_InterfacesCantContainFields, ErrorLocation); 491diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportRefFields, ErrorLocation); 494diagnostics.Add(ErrorCode.ERR_RefFieldInNonRefStruct, ErrorLocation); 497diagnostics.Add(ErrorCode.ERR_RefFieldCannotReferToRefStruct, typeSyntax.SkipScoped(out _).Location); 511diagnosticsForFirstDeclarator.Add(ErrorCode.ERR_ImplicitlyTypedVariableCannotBeConst, typeSyntax.Location); 521diagnosticsForFirstDeclarator.Add(ErrorCode.ERR_ImplicitlyTypedVariableMultipleDeclarator, typeSyntax.Location); 561diagnostics.Add(ErrorCode.ERR_FixedNotInStruct, ErrorLocation); 566diagnostics.Add(ErrorCode.ERR_FixedFieldMustNotBeRef, ErrorLocation); 574diagnostics.Add(ErrorCode.ERR_IllegalFixedType, loc); 579diagnosticsForFirstDeclarator.Add(ErrorCode.ERR_UnsafeNeeded, declarator.Location);
Symbols\Source\SourceMemberMethodSymbol.cs (2)
995diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportDefaultInterfaceImplementation, location); 1000diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, location);
Symbols\Source\SourceMethodSymbol.cs (2)
67diagnostics.Add(ErrorCode.ERR_BadAsyncArgType, getLocation(parameter, location)); 71diagnostics.Add(ErrorCode.ERR_UnsafeAsyncArgType, getLocation(parameter, location));
Symbols\Source\SourceMethodSymbolWithAttributes.cs (12)
591diagnostics.Add(ErrorCode.ERR_UnscopedRefAttributeUnsupportedMemberTarget, arguments.AttributeSyntaxOpt.Location); 667diagnostics.Add(ErrorCode.ERR_ConditionalOnInterfaceMethod, node.Location); 769diagnostics.Add(ErrorCode.ERR_DllImportOnInvalidMethod, arguments.AttributeSyntaxOpt.Name.Location); 785diagnostics.Add(ErrorCode.ERR_DllImportOnGenericMethod, arguments.AttributeSyntaxOpt.Name.Location); 890diagnostics.Add(ErrorCode.ERR_ModuleInitializerMethodMustBeOrdinary, arguments.AttributeSyntaxOpt.Location); 922diagnostics.Add(ErrorCode.ERR_ModuleInitializerCannotBeUnmanagedCallersOnly, arguments.AttributeSyntaxOpt.Location); 964diagnostics.Add(ErrorCode.ERR_CannotUseRefInUnmanagedCallersOnly, syntax.Location); 1039diagnostics.Add(ErrorCode.ERR_ComImportWithUserCtor, this.Locations[0]); 1100diagnostics.Add(ErrorCode.ERR_BadAsyncReturn, errorLocation); 1120diagnostics.Add(ErrorCode.ERR_SecurityCriticalOrSecuritySafeCriticalOnAsyncInClassOrStruct, errorLocation); 1129diagnostics.Add(ErrorCode.ERR_SynchronizedAsyncMethod, errorLocation); 1155diagnostics.Add(ErrorCode.ERR_MultipleEnumeratorCancellationAttributes, errorLocation);
Symbols\Source\SourceNamedTypeSymbol.cs (4)
196diagnostics.Add(ErrorCode.ERR_IllegalVarianceSyntax, tp.VarianceKeyword.GetLocation()); 1119diagnostics.Add(ErrorCode.ERR_CantUseRequiredAttribute, arguments.AttributeSyntaxOpt.Name.Location); 1482diagnostics.Add(ErrorCode.ERR_ComImportWithoutUuidAttribute, allAttributeSyntaxNodes[index].Name.Location); 1539diagnostics.Add(ErrorCode.ERR_DefaultMemberOnIndexedType, allAttributeSyntaxNodes[index].Name.Location);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (5)
131diagnostics.Add(ErrorCode.ERR_BadRecordBase, baseLocation); 136diagnostics.Add(ErrorCode.ERR_BadInheritanceFromRecord, baseLocation); 461diagnostics.Add(ErrorCode.ERR_BadBaseType, typeSyntax.GetLocation()); 625diagnostics.Add(ErrorCode.ERR_ObjectCantHaveBases, new SourceLocation(name)); 635diagnostics.Add(ErrorCode.ERR_UnexpectedArgumentList, primaryConstructorBaseType.ArgumentList.Location);
Symbols\Source\SourceNamedTypeSymbol_Enum.cs (1)
68diagnostics.Add(ErrorCode.ERR_IntegralTypeExpected, typeSyntax.Location);
Symbols\Source\SourceNamespaceSymbol.cs (1)
401diagnostics.Add(ErrorCode.ERR_NoNamespacePrivate, symbol.Locations.FirstOrNone());
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (3)
55diagnostics.Add(ErrorCode.WRN_FinalizeMethod, location); 64diagnostics.Add(ErrorCode.ERR_PartialMethodNotExplicit, location); 69diagnostics.Add(ErrorCode.ERR_PartialMethodOnlyInPartialClass, location);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (13)
250diagnostics.Add(ErrorCode.ERR_BadExtensionAgg, loc); 254diagnostics.Add(ErrorCode.ERR_BadExtensionMeth, location); 555diagnostics.Add(ErrorCode.ERR_IllegalVarianceSyntax, parameter.VarianceKeyword.GetLocation()); 659diagnostics.Add(ErrorCode.ERR_PartialMethodReturnTypeDifference, implementation.Locations[0]); 669diagnostics.Add(ErrorCode.ERR_PartialMethodRefReturnDifference, implementation.Locations[0]); 674diagnostics.Add(ErrorCode.ERR_PartialMethodStaticDifference, implementation.Locations[0]); 679diagnostics.Add(ErrorCode.ERR_PartialMethodReadOnlyDifference, implementation.Locations[0]); 684diagnostics.Add(ErrorCode.ERR_PartialMethodExtensionDifference, implementation.Locations[0]); 689diagnostics.Add(ErrorCode.ERR_PartialMethodUnsafeDifference, implementation.Locations[0]); 694diagnostics.Add(ErrorCode.ERR_PartialMethodParamsDifference, implementation.Locations[0]); 700diagnostics.Add(ErrorCode.ERR_PartialMethodAccessibilityDifference, implementation.Locations[0]); 708diagnostics.Add(ErrorCode.ERR_PartialMethodExtendedModDifference, implementation.Locations[0]); 736diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInReturnTypeOnPartial, implementingMethod.Locations[0]);
Symbols\Source\SourceOrdinaryMethodSymbolBase.cs (4)
333diagnostics.Add(ErrorCode.ERR_PartialMethodInvalidModifier, location); 410diagnostics.Add(ErrorCode.ERR_BadAsyncLacksBody, location); 426diagnostics.Add(ErrorCode.ERR_BadVarargs, location); 430diagnostics.Add(ErrorCode.ERR_VarargsAsync, location);
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
569diagnostics.Add(ErrorCode.ERR_BadInitAccessor, location);
Symbols\Source\SourcePropertySymbol.cs (6)
194diagnostics.Add(ErrorCode.ERR_DuplicateAccessor, accessor.Keyword.GetLocation()); 209diagnostics.Add(ErrorCode.ERR_DuplicateAccessor, accessor.Keyword.GetLocation()); 214diagnostics.Add(ErrorCode.ERR_GetOrSetExpected, accessor.Keyword.GetLocation()); 473diagnostics.Add(ErrorCode.ERR_IndexerCantHaveVoidType, Location); 494diagnostics.Add(ErrorCode.ERR_IndexerNeedsParam, parameterSyntaxOpt.GetLastToken().GetLocation()); 507diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, arglistToken.GetLocation());
Symbols\Source\SourcePropertySymbolBase.cs (11)
274diagnostics.Add(ErrorCode.ERR_InstancePropertyInitializerInInterface, location); 278diagnostics.Add(ErrorCode.ERR_InitializerOnNonAutoProperty, location); 673diagnostics.Add(ErrorCode.ERR_RefReturningPropertiesCannotBeRequired, Location); 684diagnostics.Add(ErrorCode.ERR_AutoPropsInRoStruct, Location); 698diagnostics.Add(ErrorCode.ERR_AutoPropertyCannotBeRefReturning, Location); 704diagnostics.Add(ErrorCode.ERR_AutoPropertyMustOverrideSet, Location); 720diagnostics.Add(ErrorCode.ERR_RefPropertyCannotHaveSetAccessor, _setMethod.Locations[0]); 749diagnostics.Add(ErrorCode.ERR_RefPropertyMustHaveGetAccessor, Location); 754diagnostics.Add(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, _setMethod!.Locations[0]); 1267diagnostics.Add(ErrorCode.ERR_ExplicitDynamicAttr, arguments.AttributeSyntaxOpt.Location); 1314diagnostics.Add(ErrorCode.ERR_UnscopedRefAttributeUnsupportedMemberTarget, arguments.AttributeSyntaxOpt.Location);
Symbols\Source\SourceUserDefinedConversionSymbol.cs (2)
34diagnostics.Add(ErrorCode.ERR_ImplicitConversionOperatorCantBeChecked, syntax.CheckedKeyword.GetLocation()); 81diagnostics.Add(ErrorCode.ERR_OvlUnaryOperatorExpected, syntax.ParameterList.GetLocation());
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (13)
56diagnostics.Add(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, this.Locations[0]); 243diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, new SourceLocation(arglistToken)); 333diagnostics.Add(ErrorCode.ERR_IllegalRefParam, this.Locations[0]); 467diagnostics.Add(IsAbstract || IsVirtual ? ErrorCode.ERR_AbstractConversionNotInvolvingContainedType : ErrorCode.ERR_ConversionNotInvolvingContainedType, this.Locations[0]); 478diagnostics.Add(ErrorCode.ERR_IdentityConversion, this.Locations[0]); 591diagnostics.Add(ErrorCode.ERR_OperatorCantReturnVoid, this.Locations[0]); 603diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadUnaryOperatorSignature, this.Locations[0]); 617diagnostics.Add(ErrorCode.ERR_OpTFRetType, this.Locations[0]); 623diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadUnaryOperatorSignature, this.Locations[0]); 673diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractIncDecSignature : ErrorCode.ERR_BadIncDecSignature, this.Locations[0]); 682diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractIncDecRetType : ErrorCode.ERR_BadIncDecRetType, this.Locations[0]); 722diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractShiftOperatorSignature : ErrorCode.ERR_BadShiftOperatorSignature, this.Locations[0]); 741diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractBinaryOperatorSignature : ErrorCode.ERR_BadBinaryOperatorSignature, this.Locations[0]);
Symbols\Symbol.cs (7)
1362diagnostics.Add(ErrorCode.ERR_BlockBodyAndExpressionBody, syntax.GetLocation()); 1393diagnostics.Add(ErrorCode.ERR_ExplicitDynamicAttr, arguments.AttributeSyntaxOpt.Location); 1410diagnostics.Add(ErrorCode.ERR_ExplicitTupleElementNamesAttribute, arguments.AttributeSyntaxOpt.Location); 1416diagnostics.Add(ErrorCode.ERR_ExplicitNullableAttribute, arguments.AttributeSyntaxOpt.Location); 1434diagnostics.Add(ErrorCode.ERR_ExplicitExtension, arguments.AttributeSyntaxOpt.Location); 1440diagnostics.Add(ErrorCode.ERR_ExplicitRequiredMember, arguments.AttributeSyntaxOpt.Location); 1446diagnostics.Add(ErrorCode.ERR_ExplicitScopedRef, arguments.AttributeSyntaxOpt.Location);
Symbols\Symbol_Attributes.cs (1)
708diagnostics.Add(ErrorCode.ERR_GlobalAttributesNotAllowed, targetOpt.Identifier.GetLocation());
Symbols\SymbolExtensions.cs (1)
300diagnostics.Add(ErrorCode.ERR_IllegalUnsafe, errorLocation);
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
134((BindingDiagnosticBag)arguments.Diagnostics).Add(ErrorCode.ERR_DoNotUseFixedBufferAttrOnProperty, arguments.AttributeSyntaxOpt.Name.Location);
Symbols\TypeSymbol.cs (1)
1868diagnostics.Add(
Symbols\VarianceSafety.cs (1)
92diagnostics.Add(ErrorCode.ERR_VarianceInterfaceNesting, member.Locations[0]);
Syntax\SyntaxNodeExtensions.cs (1)
340diagnostics.Add(ErrorCode.ERR_VarInvocationLvalueReserved, expression.GetLocation());