521 references to Add
Microsoft.CodeAnalysis.CSharp (521)
Binder\Binder.QueryTranslationState.cs (1)
84diagnostics.Add(ErrorCode.ERR_QueryDuplicateRangeVariable, identifier.GetLocation(), name);
Binder\Binder.ValueChecks.cs (2)
1032diagnostics.Add(ErrorCode.WRN_AssignmentToLockOrDispose, local.Syntax.Location, localSymbol); 1166diagnostics.Add(ErrorCode.WRN_AssignmentToLockOrDispose, parameter.Syntax.Location, parameterSymbol.Name);
Binder\Binder_Constraints.cs (2)
455diagnostics.Add(ErrorCode.ERR_BadVisBound, location, containingSymbol, constraintType.Type); 471diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, location, constraintType.Type, containingSymbol);
Binder\Binder_Expressions.cs (28)
324diagnostics.Add(op.NoCommonTypeError, op.Syntax.Location, trueArg, falseArg); 376diagnostics.Add(ErrorCode.ERR_ImplicitObjectCreationNoTargetType, expr.Syntax.GetLocation(), expr.Display); 458diagnostics.Add(ErrorCode.WRN_CapturedPrimaryConstructorParameterInFieldInitializer, syntax.Location, parameter); 1509diagnostics.Add(ErrorCode.ERR_ManagedAddr, location, type); 1513diagnostics.Add(ErrorCode.WRN_ManagedAddr, location, type); 2744diagnostics.Add(ErrorCode.ERR_ConvertToStaticClass, syntax.Location, targetType); 2750diagnostics.Add(ErrorCode.ERR_ValueCantBeNull, syntax.Location, targetType); 2761diagnostics.Add(ErrorCode.ERR_AmbigUDConv, syntax.Location, originalUserDefinedConversions[0], originalUserDefinedConversions[1], operand.Display, targetType); 2768diagnostics.Add(ErrorCode.ERR_NoExplicitConv, syntax.Location, distinguisher1.First, distinguisher1.Second); 2781diagnostics.Add(ErrorCode.ERR_NoExplicitConv, syntax.Location, MessageID.IDS_SK_METHOD.Localize(), targetType); 2836diagnostics.Add(errorCode, syntax.Location, ((BoundUnconvertedAddressOfOperator)operand).Operand.Name, targetType); 2843diagnostics.Add(ErrorCode.ERR_NoExplicitConv, syntax.Location, distinguisher.First, distinguisher.Second); 3721diagnostics.Add(ErrorCode.ERR_InterpolatedStringHandlerArgumentAttributeMalformed, unconvertedString.Syntax.Location, correspondingParameter, handlerType); 3820diagnostics.Add( 4821diagnostics.Add(ErrorCode.ERR_ObjectCallingBaseConstructor, constructor.GetFirstLocation(), containingType); 4832diagnostics.Add(ErrorCode.ERR_StructWithBaseConstructorCall, constructor.GetFirstLocation(), containingType); 4951diagnostics.Add(ErrorCode.ERR_RecursiveConstructorCall, 5000diagnostics.Add(ErrorCode.WRN_CapturedPrimaryConstructorParameterPassedToBase, syntax.Location, parameter); 5301diagnostics.Add(ErrorCode.ERR_BadCtorArgCount, node.Location, type, 0); 5425diagnostics.Add(ErrorCode.ERR_MethDelegateMismatch, node.Location, 5510diagnostics.Add(ErrorCode.ERR_InstantiatingStaticClass, node.Location, type); 6152diagnostics.Add(ErrorCode.ERR_RequiredMembersMustBeAssignedValue, initializerExpression.Syntax.Location, requiredMember); 6636diagnostics.Add(ErrorCode.ERR_NoNewAbstract, node.Location, type); 6899diagnostics.Add(ErrorCode.ERR_NoNewAbstract, node.Location, type); 7040diagnostics.Add(ErrorCode.ERR_NoNewTyvar, node.Location, typeParameter); 7055diagnostics.Add(ErrorCode.ERR_NewTyvarWithArgs, node.Location, typeParameter); 7184diagnostics.Add(ErrorCode.ERR_BadAccess, errorLocation, result.ValidResult.Member); 7631diagnostics.Add(ErrorCode.ERR_BadUnaryOp, operatorToken.GetLocation(), SyntaxFacts.GetText(operatorToken.Kind()), leftType);
Binder\Binder_InterpolatedString.cs (3)
804diagnostics.Add(ErrorCode.ERR_InterpolatedStringHandlerCreationCannotUseDynamic, syntax.Location, interpolatedStringHandlerType.Name); 989diagnostics.Add(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnMalformed, part.Syntax.Location, method); 999diagnostics.Add(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnInconsistent, part.Syntax.Location, method, expected);
Binder\Binder_Invocation.cs (3)
170diagnostics.Add( 1384diagnostics.Add(ErrorCode.ERR_BadAttributeParamDefaultArgument, syntax.Location, parameter.Name); 1675diagnostics.Add(ErrorCode.ERR_NotNullRefDefaultParameter, syntax.Location, parameter.Name, parameterType);
Binder\Binder_Lambda.cs (2)
414diagnostics.Add(ErrorCode.ERR_DuplicateParamName, lambda.ParameterLocation(i), name); 457diagnostics.Add(ErrorCode.INF_TooManyBoundLambdas, GetAnonymousFunctionLocation(pair.Key), truncatedToHundreds);
Binder\Binder_NameConflicts.cs (2)
71diagnostics.Add(ErrorCode.ERR_LocalSameNameAsTypeParam, GetLocation(p), name); 77diagnostics.Add(ErrorCode.ERR_DuplicateParamName, GetLocation(p), name);
Binder\Binder_Operators.cs (1)
4351diagnostics.Add(ErrorCode.ERR_RefConditionalDifferentTypes, falseExpr.Syntax.Location, trueType);
Binder\Binder_Patterns.cs (8)
66diagnostics.Add(ErrorCode.ERR_IsPatternImpossible, node.Location, expression.Type); 83diagnostics.Add(ErrorCode.WRN_IsPatternAlways, node.Location, expression.Type); 436diagnostics.Add(ErrorCode.ERR_CannotMatchOnINumberBase, node.Location, inputType); 613diagnostics.Add(ErrorCode.ERR_ValueCantBeNull, expression.Syntax.Location, inputType); 623diagnostics.Add(ErrorCode.ERR_PatternWrongType, expression.Syntax.Location, inputType, expression.Display); 634diagnostics.Add(ErrorCode.ERR_ConstantPatternVsOpenType, 673diagnostics.Add(ErrorCode.ERR_PatternSpanCharCannotBeStringNull, convertedExpression.Syntax.Location, inputType); 1310diagnostics.Add(ErrorCode.ERR_TupleElementNameMismatch, node.Location, name, $"Item{tupleIndex + 1}");
Binder\Binder_Query.cs (4)
949diagnostics.Add(ErrorCode.ERR_BadSKunknown, ultimateReceiver.Syntax.Location, ((BoundNamespaceExpression)ultimateReceiver).NamespaceSymbol, MessageID.IDS_SK_NAMESPACE.Localize()); 954diagnostics.Add(ErrorCode.ERR_QueryNoProvider, node.Location, MessageID.IDS_AnonMethod.Localize(), methodName); 970diagnostics.Add(ErrorCode.ERR_QueryNoProvider, node.Location, MessageID.IDS_SK_METHOD.Localize(), methodName); 994diagnostics.Add(ErrorCode.ERR_QueryNoProvider, node.Location, "void", methodName);
Binder\Binder_Statements.cs (7)
582diagnostics.Add(ErrorCode.ERR_LocalFunctionMissingBody, localSymbol.GetFirstLocation(), localSymbol); 588diagnostics.Add(ErrorCode.ERR_ExternHasBody, localSymbol.GetFirstLocation(), localSymbol); 628blockDiagnostics.Add(ErrorCode.ERR_ReturnExpected, localSymbol.GetFirstLocation(), localSymbol); 1342additionalDiagnostics.Add(ErrorCode.WRN_PatternBadSignature, initializer.Syntax.Location, initializer.Type, "fixed", patternMethodSymbol); 3931diagnostics.Add(ErrorCode.ERR_BadCtorArgCount, diagnosticsLocation, baseType, /*desired param count*/ 0); 3945diagnostics.Add(ErrorCode.ERR_BadAccess, diagnosticsLocation, baseConstructor); 3985diagnostics.Add(ErrorCode.ERR_NoCopyConstructorInBaseType, diagnosticsLocation, baseType);
Binder\Binder_Symbols.cs (11)
1696diagnostics.Add(ErrorCode.ERR_MissingPredefinedMember, syntax.Location, descriptor.DeclaringTypeMetadataName, descriptor.Name); 2572return diagnostics.Add(ErrorCode.ERR_DottedTypeNameNotFoundInAgg, location, whereText, qualifierOpt); 2584? diagnostics.Add(ErrorCode.ERR_GlobalSingleTypeNameNotFound, location, whereText) 2585: diagnostics.Add(ErrorCode.ERR_GlobalSingleTypeNameNotFoundFwd, location, whereText, forwardedToAssembly); 2599? diagnostics.Add(ErrorCode.ERR_DottedTypeNameNotFoundInNS, location, whereText, container) 2600: diagnostics.Add(ErrorCode.ERR_DottedTypeNameNotFoundInNSFwd, location, whereText, container, forwardedToAssembly); 2607return diagnostics.Add(ErrorCode.ERR_AliasNotFound, location, whereText); 2621? diagnostics.Add(ErrorCode.ERR_SingleTypeNameNotFoundFwd, location, whereText, forwardedToAssembly) 2622: diagnostics.Add(ErrorCode.ERR_DottedTypeNameNotFoundInNSFwd, location, whereText, qualifierOpt, forwardedToAssembly); 2625return diagnostics.Add(ErrorCode.ERR_SingleTypeNameNotFound, location, whereText); 2650diagnostics.Add(ErrorCode.ERR_CycleInTypeForwarder, location, fullName, forwardedType.ContainingAssembly.Name);
Binder\Binder_TupleOperators.cs (1)
321diagnostics.Add(ErrorCode.WRN_TupleBinopLiteralNameMismatch, location, complaintName);
Binder\BindingDiagnosticBag.cs (2)
162=> Add(code, syntax.Location, args); 165=> Add(code, syntax.GetLocation()!, args);
Binder\ExecutableCodeBinder.cs (1)
158diagnostics.Add(ErrorCode.ERR_IteratorMustBeAsync, errorLocation, iterator, returnType);
Binder\ForEachLoopBinder.cs (13)
800diagnostics.Add(errorCode, collectionSyntax.Location, 847diagnostics.Add(ErrorCode.ERR_InlineArrayForEachNotSupported, collectionExpr.Syntax.GetLocation(), collectionExpr.Type); 895diagnostics.Add(ErrorCode.ERR_InlineArrayForEachNotSupported, collectionExpr.Syntax.GetLocation(), collectionExpr.Type); 926diagnostics.Add(ErrorCode.ERR_AnonMethGrpInForEach, collectionSyntax.Location, collectionExpr.Display); 975diagnostics.Add(ErrorCode.ERR_ForEachMissingMember, collectionSyntax.Location, unwrappedCollectionExprType, WellKnownMemberNames.GetEnumeratorMethodName); 982diagnostics.Add(ErrorCode.ERR_AwaitForEachMissingMember, collectionSyntax.Location, unwrappedCollectionExprType, WellKnownMemberNames.GetAsyncEnumeratorMethodName); 1037diagnostics.Add(isAsync ? ErrorCode.ERR_BadGetAsyncEnumerator : ErrorCode.ERR_BadGetEnumerator, collectionSyntax.Location, getEnumeratorMethod.ReturnType, getEnumeratorMethod); 1093diagnostics.Add(ErrorCode.ERR_AwaitForEachMissingMember, collectionSyntax.Location, unwrappedCollectionExprType, WellKnownMemberNames.GetAsyncEnumeratorMethodName); 1450diagnostics.Add(ErrorCode.WRN_PatternNotPublicOrNotInstance, collectionSyntax.Location, patternType, patternName.Localize(), result); 1485diagnostics.Add(ErrorCode.WRN_PatternIsAmbiguous, collectionSyntax.Location, patternType, MessageID.IDS_Collection.Localize(), 1556diagnostics.Add(ErrorCode.WRN_PatternIsAmbiguous, collectionSyntax.Location, collectionExpr.Type, MessageID.IDS_Collection.Localize(), 1715diagnostics.Add(ErrorCode.WRN_PatternBadSignature, collectionSyntax.Location, enumeratorType, MessageID.IDS_Collection.Localize(), patternMemberCandidate); 1892diagnostics.Add(ErrorCode.ERR_NoSuchMember, collectionSyntax.Location, patternType, memberName);
Binder\InMethodBinder.cs (4)
268diagnostics.Add(ErrorCode.ERR_LocalIllegallyOverrides, newLocation, name); 284diagnostics.Add(ErrorCode.ERR_QueryRangeVariableOverrides, newLocation, name); 296diagnostics.Add(ErrorCode.ERR_LocalSameNameAsTypeParam, newLocation, name); 312diagnostics.Add(ErrorCode.ERR_QueryRangeVariableSameAsTypeParam, newLocation, name);
Binder\LocalScopeBinder.cs (3)
516diagnostics.Add(ErrorCode.ERR_LocalDuplicate, newLocation, name); 527diagnostics.Add(ErrorCode.ERR_LocalIllegallyOverrides, newLocation, name); 532diagnostics.Add(ErrorCode.ERR_QueryRangeVariableOverrides, newLocation, name);
Binder\Semantics\Conversions\Conversions.cs (2)
334diagnostics.Add( 345diagnostics.Add(
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (9)
522diagnostics.Add(ErrorCode.ERR_CollectionExpressionMissingAdd, location, receiver.Type); 662diagnostics.Add(ErrorCode.ERR_QueryNoProvider, location, receiverOpt.Type, symbol.Name); 666diagnostics.Add(ErrorCode.ERR_InitializerAddHasWrongSignature, location, symbol); 670diagnostics.Add(ErrorCode.ERR_BadAwaitArg, location, receiverOpt.Type); 674diagnostics.Add(ErrorCode.ERR_FuncPtrMethMustBeStatic, location, symbol); 702diagnostics.Add(delegateOrFunctionPointerType.IsFunctionPointer() ? ErrorCode.ERR_FuncPtrRefMismatch : ErrorCode.ERR_DelegateRefMismatch, 711diagnostics.Add(ErrorCode.ERR_BadRetType, location, method, method.ReturnType); 1132diagnostics.Add(ErrorCode.ERR_CollectionExpressionMissingAdd, location, receiver.Type); 1408diagnostics.Add(ErrorCode.ERR_QueryMultipleProviders, location, receiver.Type, name);
Binder\SwitchBinder.cs (1)
266diagnostics.Add(ErrorCode.WRN_GotoCaseShouldConvert, node.Location, SwitchGoverningType);
Binder\SwitchBinder_Patterns.cs (1)
112diagnostics.Add(ErrorCode.ERR_DuplicateCaseLabel, syntax.Location, cp.ConstantValue.GetValueToDisplay());
Binder\WithLambdaParametersBinder.cs (2)
136diagnostics.Add(ErrorCode.ERR_LocalIllegallyOverrides, newLocation, name); 149diagnostics.Add(ErrorCode.ERR_QueryRangeVariableOverrides, newLocation, name);
BoundTree\UnboundLambda.cs (2)
855diagnostics.Add(ErrorCode.ERR_AnonymousReturnExpected, lambdaSymbol.DiagnosticLocation, this.MessageID.Localize(), delegateType); 871diagnostics.Add(ErrorCode.ERR_CantConvAsyncAnonFuncReturns, lambdaSymbol.DiagnosticLocation, lambdaSymbol.MessageID.Localize(), delegateType);
CodeGen\EmitConversion.cs (1)
394_diagnostics.Add(ErrorCode.ERR_BadDelegateConstructor, syntax.Location, delegateType);
Compilation\CSharpCompilation.cs (6)
1939diagnostics.Add(ErrorCode.WRN_MainIgnored, NoLocation.Singleton, mainTypeName); 1946diagnostics.Add(ErrorCode.ERR_MainClassNotFound, NoLocation.Singleton, mainTypeName); 1953diagnostics.Add(ErrorCode.ERR_MainClassNotClass, mainTypeOrNamespace.GetFirstLocation(), mainTypeOrNamespace); 2002noMainFoundDiagnostics.Add(ErrorCode.WRN_InvalidMainSig, candidate.GetFirstLocation(), candidate); 2010noMainFoundDiagnostics.Add(ErrorCode.WRN_MainCantBeGeneric, candidate.GetFirstLocation(), candidate); 2112diagnostics.Add(ErrorCode.ERR_NoMainInClass, mainType.GetFirstLocation(), mainType);
Compiler\DocumentationCommentCompiler.cs (5)
112diagnostics.Add(ErrorCode.ERR_DocFileGen, Location.None, e.Message); 318_diagnostics.Add(ErrorCode.WRN_MissingXMLComment, location, symbol); 389_diagnostics.Add(ErrorCode.WRN_MissingParamTag, location, parameter.Name, symbol); 403_diagnostics.Add(ErrorCode.WRN_MissingTypeParamTag, location, typeParameter, symbol); 564_diagnostics.Add(ErrorCode.WRN_XMLParseError, location, GetDescription(e));
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (1)
283_diagnostics.Add(ErrorCode.WRN_FailedInclude, location, filePathValue, xpathValue, new LocalizableErrorArgument(MessageID.IDS_OperationCausedStackOverflow));
Compiler\MethodCompiler.cs (1)
201diagnostics.Add(ErrorCode.ERR_ModuleEmitFailure, NoLocation.Singleton, ((Cci.INamedEntity)moduleBeingBuiltOpt).Name,
Compiler\TypeCompilationState.cs (1)
232diagnostics.Add(ErrorCode.ERR_IndirectRecursiveConstructorCall, syntax.Location, method1);
Emitter\Model\PEAssemblyBuilder.cs (1)
583diagnostics.Add(ErrorCode.ERR_TypeReserved, userDefinedAttribute.GetFirstLocation(), description.FullName);
FlowAnalysis\FlowAnalysisPass.cs (1)
103diagnostics.Add(ErrorCode.ERR_ReturnExpected, method.GetFirstLocation(), method);
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (2)
356F.Diagnostics.Add(ErrorCode.ERR_WrongArityAsyncReturn, F.Syntax.Location, builderType); 494F.Diagnostics.Add(ErrorCode.ERR_MissingPredefinedMember, F.Syntax.Location, builderType, methodName);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
120diagnostics.Add(ErrorCode.ERR_MissingPredefinedMember, node.Syntax.Location, r.ExpressionType, "Lambda");
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
61_diagnostics.Add(code, node.Syntax.Location, args); 581_diagnostics.Add(ErrorCode.ERR_ExpressionTreeCantContainRefStruct, p.GetFirstLocation(), p.Type.Name);
Lowering\DiagnosticsPass_Warnings.cs (2)
333_diagnostics.Add(ErrorCode.WRN_BadRefCompareLeft, node.Syntax.Location, t); 338_diagnostics.Add(ErrorCode.WRN_BadRefCompareRight, node.Syntax.Location, t);
Lowering\LocalRewriter\LocalRewriter_Call.cs (9)
163this._diagnostics.Add(ErrorCode.ERR_InterceptorCannotBeGeneric, attributeLocation, interceptor, method); 195this._diagnostics.Add(ErrorCode.ERR_InterceptorNotAccessible, attributeLocation, interceptor, containingMethod); 207this._diagnostics.Add(ErrorCode.ERR_InterceptorSignatureMismatch, attributeLocation, method, interceptor); 218diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInReturnTypeOnInterceptor, attributeLocation, method); 228this._diagnostics.Add(ErrorCode.WRN_InterceptorSignatureMismatch, attributeLocation, method, interceptor); 239this._diagnostics.Add(ErrorCode.ERR_InterceptorMustHaveMatchingThisParameter, attributeLocation, methodThisParameter, method); 242this._diagnostics.Add(ErrorCode.ERR_InterceptorMustNotHaveThisParameter, attributeLocation, method); 251this._diagnostics.Add(ErrorCode.ERR_InterceptorMustHaveMatchingThisParameter, attributeLocation, method.Parameters[0], method); 261diagnostics.Add(ErrorCode.ERR_InterceptorScopedMismatch, attributeLocation, method, symbolForCompare);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
133_diagnostics.Add( 825diagnostics.Add(
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
643F.Diagnostics.Add(ErrorCode.ERR_RefReturningCallAndAwait, F.Syntax.Location, call.Method);
Symbols\AliasSymbol.cs (1)
361diagnostics.Add(ErrorCode.ERR_BadExternAlias, GetFirstLocation(), Name);
Symbols\AnonymousTypes\AnonymousTypeManager.SymbolCollection.cs (2)
79diagnostics.Add(ErrorCode.ERR_MissingPredefinedMember, NoLocation.Singleton, 94diagnostics.Add(ErrorCode.ERR_MissingPredefinedMember, NoLocation.Singleton,
Symbols\Attributes\AttributeData.cs (8)
400diagnostics.Add(ErrorCode.ERR_PrincipalPermissionInvalidAction, syntaxLocation, displayString); 430diagnostics.Add(ErrorCode.ERR_SecurityAttributeInvalidAction, syntaxLocation, nodeOpt != null ? nodeOpt.GetErrorDisplayName() : "", displayString); 446diagnostics.Add(ErrorCode.ERR_SecurityAttributeInvalidActionTypeOrMethod, syntaxLocation, displayString); 460diagnostics.Add(ErrorCode.ERR_SecurityAttributeInvalidActionAssembly, syntaxLocation, displayString); 536diagnostics.Add(ErrorCode.ERR_PermissionSetAttributeInvalidFile, argSyntaxLocation, fileName ?? "<null>", filePropName); 592diagnostics.Add(ErrorCode.ERR_InvalidAttributeArgument, this.GetAttributeArgumentLocation(0), nodeOpt != null ? nodeOpt.GetErrorDisplayName() : ""); 618diagnostics.Add(ErrorCode.ERR_InvalidAttributeArgument, this.GetAttributeArgumentLocation(0), node.GetErrorDisplayName()); 635diagnostics.Add(ErrorCode.ERR_InvalidAttributeArgument, attributeArgumentSyntaxLocation, nodeOpt != null ? nodeOpt.GetErrorDisplayName() : "");
Symbols\ConstantValueUtils.cs (3)
91diagnostics.Add(ErrorCode.ERR_InvalidConstantDeclarationType, initValueNode.Location, thisSymbol, typeSymbol); 123diagnostics.Add(ErrorCode.ERR_NotNullConstRefField, initValueNode.Location, thisSymbol, typeSymbol); 139diagnostics.Add(ErrorCode.ERR_NotConstantExpression, initValueNode.Location, thisSymbol);
Symbols\ConstraintsHelper.cs (2)
705args.Diagnostics.Add(ErrorCode.ERR_BogusType, args.Location, type); 743args.Diagnostics.Add(ErrorCode.ERR_BogusType, args.Location, type);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (2)
61diagnostics.Add(ErrorCode.ERR_DupReturnTypeMod, modifier.GetLocation(), modifier.Text); 66diagnostics.Add(ErrorCode.ERR_InvalidFuncPointerReturnTypeModifier, modifier.GetLocation(), modifier.Text);
Symbols\Source\ExplicitInterfaceHelpers.cs (11)
199diagnostics.Add(ErrorCode.ERR_ExplicitInterfaceImplementationInNonClassOrStruct, memberLocation, implementingMember); 275diagnostics.Add(ErrorCode.ERR_ExplicitMethodImplAccessor, memberLocation, implementingMember, interfaceMember); 281diagnostics.Add(ErrorCode.ERR_BogusExplicitImpl, memberLocation, implementingMember, interfaceMember); 287diagnostics.Add(ErrorCode.ERR_ExplicitImplParams, memberLocation, implementingMember, interfaceMember); 300diagnostics.Add(ErrorCode.ERR_InterfaceMemberNotFound, memberLocation, implementingMember); 310diagnostics.Add(ErrorCode.ERR_BadAccess, memberLocation, implementedMember); 334diagnostics.Add(ErrorCode.ERR_BadAccess, memberLocation, accessor); 359diagnostics.Add(ErrorCode.ERR_ImplBadTupleNames, memberLocation, implementingMember, implementedMember); 411diagnostics.Add(ErrorCode.ERR_ExplicitImplCollisionOnRefOut, explicitInterfaceType.GetFirstLocation(), explicitInterfaceType, implementedMember); 416diagnostics.Add(ErrorCode.WRN_ExplicitImplCollision, implementingMember.GetFirstLocation(), implementingMember); 428diagnostics.Add(ErrorCode.WRN_ExplicitImplCollision, implementingMember.GetFirstLocation(), implementingMember);
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
340diagnostics.Add(ErrorCode.ERR_MissingStructOffset, this.ErrorLocation, this.AttributeOwner);
Symbols\Source\GlobalExpressionVariable.cs (1)
112diagnostics.Add(ErrorCode.ERR_RecursivelyTypedVariable, this.ErrorLocation, this);
Symbols\Source\ModifierUtils.cs (6)
95diagnostics.Add(ErrorCode.ERR_StaticNotVirtual, errorLocation, ModifierUtils.ConvertSingleModifierToSyntaxText(oneError)); 99diagnostics.Add(ErrorCode.ERR_BadMemberFlag, errorLocation, ConvertSingleModifierToSyntaxText(oneError)); 163diagnostics.Add(ErrorCode.ERR_BadMemberFlag, errorLocation, ConvertSingleModifierToSyntaxText(DeclarationModifiers.Sealed)); 204diagnostics.Add(ErrorCode.ERR_InvalidModifierForLanguageVersion, errorLocation, 498diagnostics.Add(ErrorCode.ERR_RequiredMemberCannotBeLessVisibleThanContainingType, errorLocation, symbol, symbol.ContainingType); 504diagnostics.Add(ErrorCode.ERR_RequiredMemberMustBeSettable, errorLocation, symbol);
Symbols\Source\ParameterHelpers.cs (4)
632diagnostics.Add(ErrorCode.ERR_DupParamMod, modifier.GetLocation(), SyntaxFacts.GetText(modifier.Kind())); 637diagnostics.Add(ErrorCode.ERR_BadParameterModifiers, modifier.GetLocation(), SyntaxFacts.GetText(modifier.Kind()), SyntaxFacts.GetText(otherModifierKind)); 642diagnostics.Add(ErrorCode.ERR_ParamsCantBeWithModifier, modifier.GetLocation(), SyntaxFacts.GetText(otherModifierKind)); 669diagnostics.Add(ErrorCode.ERR_BadThisParam, thisKeyword.GetLocation(), owner?.Name ?? "");
Symbols\Source\SourceAssemblySymbol.cs (28)
627diagnostics.Add(ErrorCode.ERR_SignButNoPrivateKey, NoLocation.Singleton, StrongNameKeys.KeyFilePath); 743diagnostics.Add(ErrorCode.ERR_FriendAssemblySNReq, oneKey.Value.Item1, oneKey.Value.Item2); 774diagnostics.Add(ErrorCode.WRN_CmdOptionConflictsSource, NoLocation.Singleton, "DelaySign", AttributeDescription.AssemblyDelaySignAttribute.FullName); 779diagnostics.Add(ErrorCode.WRN_CmdOptionConflictsSource, NoLocation.Singleton, 815diagnostics.Add(ErrorCode.ERR_CmdOptionConflictsSource, NoLocation.Singleton, AttributeDescription.AssemblyKeyNameAttribute.FullName, "CryptoKeyContainer"); 819diagnostics.Add(ErrorCode.WRN_CmdOptionConflictsSource, NoLocation.Singleton, "CryptoKeyContainer", AttributeDescription.AssemblyKeyNameAttribute.FullName); 828diagnostics.Add(ErrorCode.WRN_AttributeIgnoredWhenPublicSigning, NoLocation.Singleton, AttributeDescription.AssemblyKeyNameAttribute.FullName); 852diagnostics.Add(ErrorCode.ERR_CmdOptionConflictsSource, NoLocation.Singleton, AttributeDescription.AssemblyKeyFileAttribute.FullName, "CryptoKeyFile"); 856diagnostics.Add(ErrorCode.WRN_CmdOptionConflictsSource, NoLocation.Singleton, "CryptoKeyFile", AttributeDescription.AssemblyKeyFileAttribute.FullName); 865diagnostics.Add(ErrorCode.WRN_AttributeIgnoredWhenPublicSigning, NoLocation.Singleton, AttributeDescription.AssemblyKeyFileAttribute.FullName); 982diagnostics.Add(ErrorCode.ERR_NetModuleNameMismatch, NoLocation.Singleton, moduleName, fileName); 999diagnostics.Add(ErrorCode.ERR_NetModuleNameMustBeUnique, NoLocation.Singleton, m.Name); 1013diagnostics.Add(ErrorCode.ERR_AgnosticToMachineModule, NoLocation.Singleton, m); 1019diagnostics.Add(ErrorCode.ERR_ConflictingMachineModule, NoLocation.Singleton, m); 1037diagnostics.Add(ErrorCode.ERR_MissingNetModuleReference, NoLocation.Singleton, referencedModuleName); 1094diagnostics.Add(ErrorCode.ERR_DuplicateNameInNS, y.GetFirstLocationOrNone(), 1258diagnostics.Add(ErrorCode.WRN_AssemblyAttributeFromModuleIsOverridden, NoLocation.Singleton, attribute.AttributeClass, netModuleName); 1264diagnostics.Add(ErrorCode.ERR_DuplicateAttributeInNetModule, NoLocation.Singleton, attribute.AttributeClass.Name, netModuleName); 2110bag.Add(ErrorCode.ERR_FriendRefNotEqualToThis, NoLocation.Singleton, 2113bag.Add(ErrorCode.ERR_FriendRefSigningMismatch, NoLocation.Singleton, 2227diagnostics.Add(ErrorCode.ERR_ForwardedTypeInThisAssembly, GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt), forwardedType); 2233diagnostics.Add(ErrorCode.ERR_ForwardedTypeIsNested, GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt), forwardedType, forwardedType.ContainingType); 2263diagnostics.Add(ErrorCode.ERR_DuplicateTypeForwarder, GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt), forwardedType); 2289diagnostics.Add(ErrorCode.WRN_InvalidAssemblyName, GetAssemblyAttributeLocationForDiagnostic(nodeOpt), displayName); 2299diagnostics.Add(ErrorCode.ERR_FriendAssemblyBadArgs, GetAssemblyAttributeLocationForDiagnostic(nodeOpt), displayName); 2404diagnostics.Add(foundBadWildcard ? ErrorCode.ERR_InvalidVersionFormatDeterministic : ErrorCode.ERR_InvalidVersionFormat, attributeArgumentSyntaxLocation, verString ?? "<null>"); 2416diagnostics.Add(ErrorCode.WRN_InvalidVersionFormat, attributeArgumentSyntaxLocation, verString ?? "<null>"); 2604diagnostics.Add(ErrorCode.ERR_InvalidAttributeArgument, attribute.GetAttributeArgumentLocation(i), (object)nodeOpt != null ? nodeOpt.GetErrorDisplayName() : "");
Symbols\Source\SourceConstructorSymbol.cs (5)
40diagnostics.Add(ErrorCode.ERR_StaticConstructorWithAccessModifiers, location, this); 55diagnostics.Add(ErrorCode.ERR_ExternHasConstructorInitializer, location, this); 60diagnostics.Add(ErrorCode.ERR_ExternHasBody, location, this); 169diagnostics.Add(ErrorCode.ERR_ConcreteMissingBody, location, this); 173diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(ContainingType), location, this);
Symbols\Source\SourceConstructorSymbolBase.cs (1)
67diagnostics.Add(ErrorCode.ERR_StaticConstParam, location, this);
Symbols\Source\SourceCustomEventAccessorSymbol.cs (1)
46diagnostics.Add(ErrorCode.ERR_ExternHasBody, this.Location, this);
Symbols\Source\SourceCustomEventSymbol.cs (1)
139diagnostics.Add(ErrorCode.ERR_EventNeedsBothAccessors, this.GetFirstLocation(), this);
Symbols\Source\SourceDelegateMethodSymbol.cs (4)
104diagnostics.Add(ErrorCode.ERR_BadVisDelegateReturn, delegateType.GetFirstLocation(), delegateType, invoke.ReturnType); 110diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, delegateType.GetFirstLocation(), invoke.ReturnType, delegateType); 119diagnostics.Add(ErrorCode.ERR_BadVisDelegateParam, delegateType.GetFirstLocation(), delegateType, parameterSymbol.Type); 123diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, delegateType.GetFirstLocation(), parameterSymbol.Type, delegateType);
Symbols\Source\SourceDestructorSymbol.cs (2)
40diagnostics.Add(ErrorCode.ERR_ExternHasBody, location, this); 46diagnostics.Add(ErrorCode.ERR_ConcreteMissingBody, location, this);
Symbols\Source\SourceEnumConstantSymbol.cs (2)
54diagnostics.Add(ErrorCode.ERR_ReservedEnumerator, this.ErrorLocation, WellKnownMemberNames.EnumBackingFieldName); 220diagnostics.Add(ErrorCode.ERR_EnumeratorOverflow, this.GetFirstLocation(), this);
Symbols\Source\SourceEventSymbol.cs (17)
535diagnostics.Add(ErrorCode.ERR_VirtualPrivate, location, this); 540diagnostics.Add(ErrorCode.ERR_StaticMemberCantBeReadOnly, location, this); 545diagnostics.Add(ErrorCode.ERR_FieldLikeEventCantBeReadOnly, location, this); 550diagnostics.Add(ErrorCode.ERR_OverrideNotNew, location, this); 555diagnostics.Add(ErrorCode.ERR_SealedNonOverride, location, this); 560diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, SyntaxFacts.GetText(SyntaxKind.AbstractKeyword)); 565diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, SyntaxFacts.GetText(SyntaxKind.VirtualKeyword)); 569diagnostics.Add(ErrorCode.ERR_AbstractAndExtern, location, this); 573diagnostics.Add(ErrorCode.ERR_AbstractAndSealed, location, this); 577diagnostics.Add(ErrorCode.ERR_AbstractNotVirtual, location, this.Kind.Localize(), this); 581diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(ContainingType), location, this); 585diagnostics.Add(ErrorCode.ERR_InstanceMemberInStaticClass, location, Name); 596diagnostics.Add(ErrorCode.ERR_BadVisEventType, location, this, this.Type); 601diagnostics.Add(ErrorCode.ERR_EventNotDelegate, location, this); 606diagnostics.Add(ErrorCode.ERR_AbstractInConcreteClass, location, this, ContainingType); 611diagnostics.Add(ErrorCode.ERR_NewVirtualInSealed, location, this, ContainingType); 780diagnostics.Add(ErrorCode.ERR_ExplicitPropertyAddingAccessor, thisAccessor.GetFirstLocation(), thisAccessor, explicitlyImplementedEvent);
Symbols\Source\SourceFieldLikeEventSymbol.cs (4)
70diagnostics.Add(ErrorCode.ERR_InterfaceEventInitializer, this.GetFirstLocation(), this); 74diagnostics.Add(ErrorCode.ERR_AbstractEventInitializer, this.GetFirstLocation(), this); 78diagnostics.Add(ErrorCode.ERR_ExternEventInitializer, this.GetFirstLocation(), this); 113diagnostics.Add(ErrorCode.ERR_EventNeedsBothAccessors, this.GetFirstLocation(), this);
Symbols\Source\SourceFieldSymbol.cs (4)
58diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(containingType), ErrorLocation, this); 62diagnostics.Add(ErrorCode.ERR_VolatileAndReadonly, ErrorLocation, this); 66diagnostics.Add(ErrorCode.ERR_InstanceMemberInStaticClass, ErrorLocation, this); 333diagnostics.Add(ErrorCode.ERR_CircConstValue, GetFirstLocation(), this);
Symbols\Source\SourceLocalSymbol.cs (1)
599diagnostics.Add(ErrorCode.ERR_CircConstValue, node.GetLocation(), this);
Symbols\Source\SourceMemberContainerSymbol.cs (56)
248diagnostics.Add(ErrorCode.ERR_PartialModifierConflict, GetFirstLocation(), this); 265diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(ContainingType), GetFirstLocation(), this); 358diagnostics.Add(ErrorCode.ERR_AbstractSealedStatic, GetFirstLocation(), this); 364diagnostics.Add(ErrorCode.ERR_SealedStaticClass, GetFirstLocation(), this); 437diagnostics.Add(ErrorCode.ERR_FileTypeNoExplicitAccessibility, GetFirstLocation(), this); 1342diagnostics.Add(ErrorCode.ERR_PartialTypeKindConflict, t.GetFirstLocation(), t); 1346diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, t.GetFirstLocation(), this, t.Name); 1385diagnostics.Add(ErrorCode.ERR_MemberNameSameAsType, member.GetFirstLocation(), this.Name); 1883diagnostics.Add(ErrorCode.ERR_FilePathCannotBeConvertedToUtf8, location, this, errorMessage); 1888diagnostics.Add(ErrorCode.ERR_FileTypeNested, location, this); 2045diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, symbol.GetFirstLocation(), this, symbol.Name); 2075diagnostics.Add(ErrorCode.ERR_DuplicateConversionInClass, conversion.GetFirstLocation(), this); 2173diagnostics.Add(ErrorCode.ERR_MemberAlreadyExists, method1.GetFirstLocation(), methodName, this); 2215diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, indexer.GetFirstLocation(), this, indexerName); 2259diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, indexer.GetFirstLocation(), this, indexerName); 2268diagnostics.Add(ErrorCode.ERR_MemberAlreadyExists, indexer.GetFirstLocation(), SyntaxFacts.GetText(SyntaxKind.ThisKeyword), this); 2302diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, dup.GetFirstLocation(), this, tp.Name); 2411diagnostics.Add(ErrorCode.ERR_StructLayoutCyclePrimaryConstructorParameter, parameterSymbol.GetFirstLocation(), parameterSymbol, type); 2419diagnostics.Add(ErrorCode.ERR_StructLayoutCycle, symbol.GetFirstLocation(), symbol, type); 2450diagnostics.Add(ErrorCode.ERR_ProtectedInStatic, member.GetFirstLocation(), member); 2514diagnostics.Add(ErrorCode.ERR_OperatorNeedsMatch, op1.GetFirstLocation(), op1, 2520diagnostics.Add(ErrorCode.ERR_CheckedOperatorNeedsMatch, op1.GetFirstLocation(), op1); 2598diagnostics.Add(ErrorCode.WRN_EqualsWithoutGetHashCode, this.GetFirstLocation(), this); 2604diagnostics.Add(ErrorCode.WRN_EqualityOpWithoutEquals, this.GetFirstLocation(), this); 2610diagnostics.Add(ErrorCode.WRN_EqualityOpWithoutGetHashCode, this.GetFirstLocation(), this); 2644diagnostics.Add(ErrorCode.ERR_RequiredMembersBaseTypeInvalid, method.GetFirstLocation(), BaseTypeNoUseSiteDiagnostics); 2704diagnostics.Add(ErrorCode.ERR_StructLayoutCycle, f.GetFirstLocation(), f, type); 2768diagnostics.Add(ErrorCode.WRN_SequentialOnPartialClass, GetFirstLocation(), this); 2781diagnostics.Add(ErrorCode.WRN_SequentialOnPartialClass, GetFirstLocation(), this); 3653diagnostics.Add(ErrorCode.ERR_PartialMethodMustHaveLatent, method.GetFirstLocation(), method); 3657diagnostics.Add(ErrorCode.ERR_PartialMethodWithAccessibilityModsMustHaveImplementation, method.GetFirstLocation(), method); 3664diagnostics.Add( 3744diagnostics.Add(errorCode, propertyToBlame.GetFirstLocation(), foundAccessor); 3859diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, GetAccessorOrPropertyLocation(propertySymbol, getNotSet), this, accessorName); 3869diagnostics.Add(ErrorCode.ERR_MemberReserved, GetAccessorOrPropertyLocation(propertySymbol, getNotSet), accessorName, this); 3895diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, GetAccessorOrEventLocation(eventSymbol, isAdder), this, accessorName); 3905diagnostics.Add(ErrorCode.ERR_MemberReserved, GetAccessorOrEventLocation(eventSymbol, isAdder), accessorName, this); 4260diagnostics.Add(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, thisEquals.GetFirstLocation(), declaration.Name); 4313diagnostics.Add(ErrorCode.ERR_NonPublicAPIInRecord, deconstruct.GetFirstLocation(), deconstruct); 4318diagnostics.Add(ErrorCode.ERR_SignatureMismatchInRecord, deconstruct.GetFirstLocation(), deconstruct, targetMethod.ReturnType); 4323diagnostics.Add(ErrorCode.ERR_StaticAPIInRecord, deconstruct.GetFirstLocation(), deconstruct); 4367diagnostics.Add(ErrorCode.ERR_CopyConstructorWrongAccessibility, constructor.GetFirstLocation(), constructor); 4412diagnostics.Add(ErrorCode.ERR_NonPrivateAPIInRecord, printMembersMethod.GetFirstLocation(), printMembersMethod); 4417diagnostics.Add(ErrorCode.ERR_NonProtectedAPIInRecord, printMembersMethod.GetFirstLocation(), printMembersMethod); 4424diagnostics.Add(ErrorCode.ERR_SignatureMismatchInRecord, printMembersMethod.GetFirstLocation(), printMembersMethod, targetMethod.ReturnType); 4462diagnostics.Add( 4600diagnostics.Add(ErrorCode.ERR_HiddenPositionalMember, param.GetFirstLocation(), symbol); 4640diagnostics.Add(ErrorCode.ERR_SealedAPIInRecord, getHashCode.GetFirstLocation(), getHashCode); 4674diagnostics.Add(ErrorCode.ERR_NonPrivateAPIInRecord, equalityContract.GetFirstLocation(), equalityContract); 4679diagnostics.Add(ErrorCode.ERR_NonProtectedAPIInRecord, equalityContract.GetFirstLocation(), equalityContract); 4686diagnostics.Add(ErrorCode.ERR_SignatureMismatchInRecord, equalityContract.GetFirstLocation(), equalityContract, targetProperty.Type); 4696diagnostics.Add(ErrorCode.ERR_EqualityContractRequiresGetter, equalityContract.GetFirstLocation(), equalityContract); 4740diagnostics.Add(ErrorCode.ERR_NonPublicAPIInRecord, thisEquals.GetFirstLocation(), thisEquals); 4745diagnostics.Add(ErrorCode.ERR_SignatureMismatchInRecord, thisEquals.GetFirstLocation(), thisEquals, targetMethod.ReturnType); 4760diagnostics.Add(ErrorCode.ERR_NotOverridableAPIInRecord, symbol.GetFirstLocation(), symbol); 4764diagnostics.Add(ErrorCode.ERR_StaticAPIInRecord, symbol.GetFirstLocation(), symbol);
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (41)
105diagnostics.Add(ErrorCode.ERR_UnimplementedAbstractMethod, this.GetFirstLocation(), this, abstractMember); 187diagnostics.Add( 294diagnostics.Add(ErrorCode.ERR_UnimplementedInterfaceMember, GetImplementsLocationOrFallback(@interface), this, interfaceMember); 304diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInInterfaceImplementedByBase, GetImplementsLocationOrFallback(@interface), this, interfaceMember); 565diagnostics.Add(ErrorCode.ERR_CantOverrideSealed, method.GetFirstLocation(), method, overridden); 716diagnostics.Add(ErrorCode.WRN_NewRequired, symbolLocation, symbol, hiddenMember); 724diagnostics.Add(ErrorCode.ERR_RequiredMemberCannotBeHidden, symbolLocation, hiddenMember, symbol); 736diagnostics.Add(ErrorCode.WRN_NewNotRequired, symbolLocation, symbol); 774diagnostics.Add(errorCode, overridingMemberLocation, overridingMember, hiddenMembers[0]); 805diagnostics.Add(ErrorCode.ERR_OverrideNotExpected, overridingMemberLocation, overridingMember); 819diagnostics.Add(ErrorCode.ERR_NoGetToOverride, overridingMemberLocation, overridingMember, overriddenProperty); 823diagnostics.Add(ErrorCode.ERR_NoSetToOverride, overridingMemberLocation, overridingMember, overriddenProperty); 827diagnostics.Add(ErrorCode.ERR_OverrideNotExpected, overridingMemberLocation, overridingMember); 837diagnostics.Add(ErrorCode.ERR_AmbigOverride, overridingMemberLocation, 860diagnostics.Add(ErrorCode.WRN_MultipleRuntimeOverrideMatches, ambiguousMethod.GetFirstLocation(), ambiguousMethod, overridingMember); 887diagnostics.Add(ErrorCode.ERR_CantOverrideBogusMethod, overridingMemberLocation, overridingMember, overriddenMember); 894diagnostics.Add(ErrorCode.ERR_CantOverrideNonVirtual, overridingMemberLocation, overridingMember, overriddenMember); 900diagnostics.Add(ErrorCode.ERR_CantOverrideSealed, overridingMemberLocation, overridingMember, overriddenMember); 906diagnostics.Add(ErrorCode.ERR_CantChangeAccessOnOverride, overridingMemberLocation, overridingMember, accessibility, overriddenMember); 913diagnostics.Add(ErrorCode.ERR_CantChangeTupleNamesOnOverride, overridingMemberLocation, overridingMember, overriddenMember); 918diagnostics.Add(ErrorCode.ERR_OverrideMustHaveRequired, overridingMemberLocation, overridingMember, overriddenMember); 941diagnostics.Add(code, overridingMemberLocation, overridingMember, leastOverriddenMember); 962diagnostics.Add(ErrorCode.ERR_CantChangeTypeOnOverride, overridingMemberLocation, overridingMember, overriddenMember, overriddenMemberType.Type); 989diagnostics.Add(ErrorCode.ERR_CantChangeRefReturnOnOverride, overridingMemberLocation, overridingMember, overriddenMember); 1002diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportCovariantReturnsOfClasses, overridingMemberLocation, overridingMember, overriddenMember, overriddenMethod.ReturnType); 1016diagnostics.Add(ErrorCode.ERR_CantChangeReturnTypeOnOverride, overridingMemberLocation, overridingMember, overriddenMember, overriddenMethod.ReturnType); 1055diagnostics.Add(ErrorCode.ERR_CantChangeRefReturnOnOverride, overridingMemberLocation, overridingProperty, overriddenProperty); 1072diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportCovariantPropertiesOfClasses, overridingMemberLocation, overridingMember, overriddenMember, overriddenMemberType.Type); 1084diagnostics.Add(ErrorCode.ERR_CantChangeTypeOnOverride, overridingMemberLocation, overridingMember, overriddenMember, overriddenMemberType.Type); 1117diagnostics.Add(ErrorCode.ERR_CantChangeInitOnlyOnOverride, overridingMemberLocation, overridingProperty, overriddenProperty); 1132diagnostics.Add(ErrorCode.ERR_NoGetToOverride, overridingMemberLocation, overridingProperty, overriddenProperty); 1138diagnostics.Add(ErrorCode.ERR_NoSetToOverride, overridingMemberLocation, overridingProperty, overriddenProperty); 1183diagnostics.Add(ErrorCode.WRN_OverridingDifferentRefness, location, overridingParameter, overriddenParameter); 1570diagnostics.Add(ErrorCode.WRN_NewNotRequired, hidingMemberLocation, hidingMember); 1591diagnostics.Add(ErrorCode.WRN_NewOrOverrideExpected, hidingMemberLocation, hidingMember, hiddenMember); 1598diagnostics.Add(ErrorCode.ERR_RequiredMemberCannotBeHidden, hidingMemberLocation, hiddenMember, hidingMember); 1611diagnostics.Add(ErrorCode.WRN_NewRequired, hidingMemberLocation, hidingMember, hiddenMembers[0]); 1622diagnostics.Add(ErrorCode.WRN_HidingDifferentRefness, location, hidingParameter, hiddenParameter); 1678diagnostics.Add(ErrorCode.ERR_HidingAbstractMethod, associatedPropertyOrEvent.GetFirstLocation(), associatedPropertyOrEvent, hiddenMember); 1693diagnostics.Add(ErrorCode.ERR_HidingAbstractMethod, hidingMemberLocation, hidingMember, hiddenMember); 1772diagnostics.Add(ErrorCode.ERR_UnifyingInterfaceInstantiations, this.GetFirstLocation(), this, interface1, interface2);
Symbols\Source\SourceMemberFieldSymbol.cs (7)
51diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, this.ErrorLocation, type, ContainingType); 56diagnostics.Add(ErrorCode.ERR_VarDeclIsStaticClass, this.ErrorLocation, type); 83diagnostics.Add(ErrorCode.ERR_BadConstType, constToken.GetLocation(), type); 88diagnostics.Add(ErrorCode.ERR_VolatileStruct, this.ErrorLocation, this, type); 95diagnostics.Add(ErrorCode.ERR_BadVisFieldType, this.ErrorLocation, this, type); 456diagnostics.Add(ErrorCode.ERR_BadMemberFlag, ErrorLocation, SyntaxFacts.GetText(SyntaxKind.ScopedKeyword)); 520diagnostics.Add(ErrorCode.ERR_RecursivelyTypedVariable, this.ErrorLocation, this);
Symbols\Source\SourceMemberMethodSymbol.cs (6)
353diagnostics.Add(code, GetFirstLocation(), this, returnType.Type); 365diagnostics.Add(code, GetFirstLocation(), this, parameter.Type); 381diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, GetFirstLocation(), returnType.Type, ContainingType); 388diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, GetFirstLocation(), param.Type, ContainingType); 1084diagnostics.Add(ErrorCode.ERR_ExternHasBody, location, this); 1088diagnostics.Add(ErrorCode.ERR_AbstractHasBody, location, this);
Symbols\Source\SourceMethodSymbol.cs (1)
75diagnostics.Add(ErrorCode.ERR_BadSpecialByRefParameter, getLocation(parameter, location), parameter.Type);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (10)
755diagnostics.Add(ErrorCode.ERR_BadArgumentToAttribute, attribute.GetAttributeArgumentLocation(0), node.GetErrorDisplayName()); 1153diagnostics.Add(ErrorCode.ERR_InterceptorsFeatureNotEnabled, attributeLocation, recommendedProperty); 1193diagnostics.Add(ErrorCode.ERR_InterceptorContainingTypeCannotBeGeneric, attributeLocation, this); 1303diagnostics.Add(ErrorCode.ERR_InterceptorNameNotInvoked, attributeLocation, referencedToken.Text); 1306diagnostics.Add(ErrorCode.ERR_InterceptorPositionBadToken, attributeLocation, referencedToken.Text); 1315diagnostics.Add(ErrorCode.ERR_InterceptorMustReferToStartOfTokenPosition, attributeLocation, referencedToken.Text, linePositionZeroBased.Line + 1, linePositionZeroBased.Character + 1); 1419diagnostics.Add(ErrorCode.ERR_CannotUseManagedTypeInUnmanagedCallersOnly, syntax.Location, type, (isParam ? MessageID.IDS_Parameter : MessageID.IDS_Return).Localize()); 1487diagnostics.Add(ErrorCode.ERR_ComImportWithImpl, this.GetFirstLocation(), this, ContainingType); 1504diagnostics.Add(errorCode, this.GetFirstLocation(), this); 1588diagnostics.Add(ErrorCode.WRN_UndecoratedCancellationTokenParameter, errorLocation, this);
Symbols\Source\SourceModuleSymbol.cs (2)
313diagnostics.Add(ErrorCode.ERR_NoPIAAssemblyMissingAttribute, NoLocation.Singleton, a, AttributeDescription.GuidAttribute.FullName); 319diagnostics.Add(ErrorCode.ERR_NoPIAAssemblyMissingAttributes, NoLocation.Singleton, a,
Symbols\Source\SourceNamedTypeSymbol.cs (7)
525diagnostics.Add(ErrorCode.ERR_PartialWrongConstraints, GetFirstLocation(), this, typeParameters[i]); 1318diagnosticsOpt.Add(ErrorCode.ERR_InvalidAttributeArgument, attribute.GetAttributeArgumentLocation(0), node.GetErrorDisplayName()); 1398diagnostics.Add(ErrorCode.ERR_BadArgumentToAttribute, attribute.GetAttributeArgumentLocation(0), node.GetErrorDisplayName()); 1591diagnostics.Add(ErrorCode.ERR_ComImportWithBase, this.GetFirstLocation(), this.Name); 1604diagnostics.Add(ErrorCode.ERR_ComImportWithInitializers, singleInitializer.Syntax.GetLocation(), this.Name); 1618diagnostics.Add(ErrorCode.ERR_ComImportWithInitializers, singleInitializer.Syntax.GetLocation(), this.Name); 1813diagnostics.Add(ErrorCode.WRN_ObsoleteMembersShouldNotBeRequired, member.GetFirstLocation(), member);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (3)
341var info = diagnostics.Add(ErrorCode.ERR_PartialMultipleBases, GetFirstLocation(), this); 679diagnostics.Add(ErrorCode.ERR_CycleInInterfaceInheritance, GetFirstLocation(), this, t))); 757diagnostics.Add(ErrorCode.ERR_CircularBase, GetFirstLocation(), declaredBase, this));
Symbols\Source\SourceNamespaceSymbol.cs (3)
354diagnostics.Add(ErrorCode.ERR_FileLocalDuplicateNameInNS, symbol.GetFirstLocationOrNone(), symbol.Name, @namespace); 357diagnostics.Add(ErrorCode.ERR_PartialTypeKindConflict, symbol.GetFirstLocationOrNone(), symbol); 360diagnostics.Add(ErrorCode.ERR_DuplicateNameInNS, symbol.GetFirstLocationOrNone(), symbol.Name, @namespace);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (27)
220diagnostics.Add(ErrorCode.ERR_RefExtensionMustBeValueTypeOrConstrainedToOne, _location, Name); 224diagnostics.Add(ErrorCode.ERR_InExtensionMustBeValueType, _location, Name); 228diagnostics.Add(ErrorCode.ERR_ExtensionMethodsDecl, _location, ContainingType.Name); 253diagnostics.Add( 487diagnostics.Add(ErrorCode.ERR_PartialMemberInconsistentTupleNames, implementation.GetFirstLocation(), definition, implementation); 611diagnostics.Add(ErrorCode.ERR_PartialMethodInconsistentConstraints, implementation.GetFirstLocation(), implementation, typeParameter2.Name); 615diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInConstraintsOnPartialImplementation, implementation.GetFirstLocation(), implementation, typeParameter2.Name); 675diagnostics.Add(report, typeParameter.GetFirstLocation(), this, typeParameter, 813diagnostics.Add(ErrorCode.ERR_PartialMethodWithNonVoidReturnMustHaveAccessMods, location, this); 817diagnostics.Add(ErrorCode.ERR_PartialMethodWithExtendedModMustHaveAccessMods, location, this); 821diagnostics.Add(ErrorCode.ERR_PartialMethodWithOutParamMustHaveAccessMods, location, this); 825diagnostics.Add(ErrorCode.ERR_VirtualPrivate, location, this); 830diagnostics.Add(ErrorCode.ERR_OverrideNotNew, location, this); 835diagnostics.Add(ErrorCode.ERR_SealedNonOverride, location, this); 840diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, SyntaxFacts.GetText(SyntaxKind.SealedKeyword)); 845diagnostics.Add(ErrorFacts.GetStaticClassReturnCode(ContainingType.IsInterfaceType()), location, ReturnType); 849diagnostics.Add(ErrorCode.ERR_AbstractAndExtern, location, this); 853diagnostics.Add(ErrorCode.ERR_AbstractAndSealed, location, this); 857diagnostics.Add(ErrorCode.ERR_AbstractNotVirtual, location, this.Kind.Localize(), this); 862diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, SyntaxFacts.GetText(SyntaxKind.AbstractKeyword)); 867diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, SyntaxFacts.GetText(SyntaxKind.VirtualKeyword)); 872diagnostics.Add(ErrorCode.ERR_StaticMemberCantBeReadOnly, location, this); 877diagnostics.Add(ErrorCode.ERR_AbstractInConcreteClass, location, this, ContainingType); 882diagnostics.Add(ErrorCode.ERR_NewVirtualInSealed, location, this, ContainingType); 890diagnostics.Add(ErrorCode.ERR_ConcreteMissingBody, location, this); 894diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(ContainingType), location, this); 898diagnostics.Add(ErrorCode.ERR_InstanceMemberInStaticClass, location, Name);
Symbols\Source\SourcePropertyAccessorSymbol.cs (9)
532diagnostics.Add(ErrorCode.ERR_AbstractInConcreteClass, location, this, ContainingType); 537diagnostics.Add(ErrorCode.ERR_NewVirtualInSealed, location, this, ContainingType); 541diagnostics.Add(ErrorCode.ERR_ConcreteMissingBody, location, this); 545diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(ContainingType), location, this); 550diagnostics.Add(ErrorCode.ERR_InvalidPropertyReadOnlyMods, location, _property); 555diagnostics.Add(ErrorCode.ERR_StaticMemberCantBeReadOnly, location, this); 560diagnostics.Add(ErrorCode.ERR_InitCannotBeReadonly, location, _property); 565diagnostics.Add(ErrorCode.ERR_AutoSetterCantBeReadOnly, location, this); 864diagnostics.Add(ErrorCode.ERR_PartialPropertyInitMismatch, implementationAccessor.GetFirstLocation(), implementationAccessor, accessorName);
Symbols\Source\SourcePropertySymbol.cs (9)
483diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, SyntaxFacts.GetText(SyntaxKind.RequiredKeyword)); 574diagnostics.Add((this.IsIndexer ? ErrorCode.ERR_BadVisIndexerReturn : ErrorCode.ERR_BadVisPropertyType), Location, this, type.Type); 579diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, Location, type.Type, ContainingType); 592diagnostics.Add(ErrorCode.ERR_PropertyCantHaveVoidType, Location, this); 633diagnostics.Add(ErrorCode.WRN_DefaultValueForUnconsumedLocation, paramNameToken.GetLocation(), paramNameToken.ValueText); 657diagnostics.Add(ErrorCode.ERR_BadVisIndexerParam, Location, this, param.Type); 661diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, Location, param.Type, this.ContainingType); 665diagnostics.Add(ErrorCode.ERR_DuplicateGeneratedName, param.TryGetFirstLocation() ?? Location, param.Name); 698diagnostics.Add(ErrorCode.ERR_PartialMemberInconsistentTupleNames, implementation.GetFirstLocation(), this, implementation);
Symbols\Source\SourcePropertySymbolBase.cs (26)
881diagnostics.Add(ErrorCode.ERR_AutoPropertyWithSetterCantBeReadOnly, Location, this); 934diagnostics.Add(ErrorCode.ERR_DuplicatePropertyAccessMods, Location, this); 938diagnostics.Add(ErrorCode.ERR_DuplicatePropertyReadOnlyMods, Location, this); 951diagnostics.Add(ErrorCode.ERR_PropertyWithNoAccessors, Location, this); 976diagnostics.Add(ErrorCode.ERR_AccessModMissingAccessor, Location, this); 982diagnostics.Add(ErrorCode.ERR_ReadOnlyModMissingAccessor, Location, this); 1065diagnostics.Add(ErrorCode.ERR_VirtualPrivate, location, this); 1070diagnostics.Add(ErrorCode.ERR_StaticMemberCantBeReadOnly, location, this); 1075diagnostics.Add(ErrorCode.ERR_OverrideNotNew, location, this); 1080diagnostics.Add(ErrorCode.ERR_SealedNonOverride, location, this); 1097diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, SyntaxFacts.GetText(SyntaxKind.AbstractKeyword)); 1102diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, SyntaxFacts.GetText(SyntaxKind.VirtualKeyword)); 1106diagnostics.Add(ErrorCode.ERR_AbstractAndExtern, location, this); 1110diagnostics.Add(ErrorCode.ERR_AbstractAndSealed, location, this); 1114diagnostics.Add(ErrorCode.ERR_AbstractNotVirtual, location, this.Kind.Localize(), this); 1118diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(ContainingType), location, this); 1123diagnostics.Add(errorCode, location, this); 1132diagnostics.Add(ErrorCode.ERR_InvalidPropertyAccessMod, accessor.GetFirstLocation(), accessor, this); 1154diagnostics.Add(ErrorCode.ERR_PrivateAbstractAccessor, accessor.GetFirstLocation(), accessor); 1173diagnostics.Add(ErrorCode.ERR_ExplicitPropertyMissingAccessor, this.Location, this, otherAccessor); 1177diagnostics.Add(ErrorCode.ERR_ExplicitPropertyAddingAccessor, thisAccessor.GetFirstLocation(), thisAccessor, explicitlyImplementedProperty); 1182diagnostics.Add(ErrorCode.ERR_ExplicitPropertyMismatchInitOnly, thisAccessor.GetFirstLocation(), thisAccessor, otherAccessor); 1835diagnostics.Add(ErrorCode.ERR_FieldCantBeRefAny, TypeLocation, type); 1839diagnostics.Add(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, TypeLocation, type); 1847diagnostics.Add(ErrorFacts.GetStaticClassReturnCode(ContainingType.IsInterfaceType()), TypeLocation, type); 1852diagnostics.Add(ErrorFacts.GetStaticClassParameterCode(ContainingType.IsInterfaceType()), TypeLocation, type);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (15)
69diagnostics.Add(ErrorCode.ERR_OperatorInStaticClass, location, this); 79diagnostics.Add(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, this.GetFirstLocation(), this); 85diagnostics.Add(ErrorCode.ERR_OperatorsMustBeStatic, this.GetFirstLocation(), this); 94diagnostics.Add(ErrorCode.ERR_AbstractAndExtern, location, this); 98diagnostics.Add(ErrorCode.ERR_AbstractNotVirtual, location, this.Kind.Localize(), this); 105diagnostics.Add(ErrorCode.ERR_ExternHasBody, location, this); 109diagnostics.Add(ErrorCode.ERR_AbstractHasBody, location, this); 117diagnostics.Add(ErrorCode.ERR_ConcreteMissingBody, location, this); 165diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, ModifierUtils.ConvertSingleModifierToSyntaxText(DeclarationModifiers.Sealed)); 211diagnostics.Add(ErrorCode.ERR_InvalidModifierForLanguageVersion, location, 456diagnostics.Add(ErrorCode.ERR_ConversionWithInterface, this.GetFirstLocation(), this); 549diagnostics.Add(ErrorCode.ERR_BadDynamicConversion, this.GetFirstLocation(), this); 577diagnostics.Add(ErrorCode.ERR_ConversionWithBase, this.GetFirstLocation(), this); 582diagnostics.Add(ErrorCode.ERR_ConversionWithDerived, this.GetFirstLocation(), this); 755diagnostics.Add(ErrorCode.ERR_BadAbstractEqualityOperatorSignature, this.GetFirstLocation(), this.ContainingType);
Symbols\Source\TypeParameterBuilder.cs (1)
48diagnostics.Add(ErrorCode.ERR_TypeVariableSameAsParent, result.GetFirstLocation(), result.Name);
Symbols\Symbol_Attributes.cs (1)
698diagnostics.Add(ErrorCode.WRN_NonECMAFeature, targetOpt.GetLocation(), MessageID.IDS_FeatureModuleAttrLoc);
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
184diagnostics.Add(ErrorCode.WRN_AttributeLocationOnBadDeclaration,
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (1)
47diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseMethod, GetFirstLocation(), this, ContainingType.BaseTypeNoUseSiteDiagnostics);
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (1)
127diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseEqualityContract, overriding.GetFirstLocation(), overriding, overriding.ContainingType.BaseTypeNoUseSiteDiagnostics);
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (1)
141diagnostics.Add(ErrorCode.ERR_BadFieldTypeInRecord, f.GetFirstLocationOrNone(), parameterType);
Symbols\Synthesized\Records\SynthesizedRecordObjectMethod.cs (1)
54diagnostics.Add(ErrorCode.ERR_DoesNotOverrideMethodFromObject, overriding.GetFirstLocation(), overriding);
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (2)
112diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseMethod, GetFirstLocation(), this, ContainingType.BaseTypeNoUseSiteDiagnostics); 290diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseMethod, overriding.GetFirstLocation(), overriding, baseType);
Symbols\Synthesized\SynthesizedHotReloadExceptionConstructorSymbol.cs (1)
46diagnostics.Add(ErrorCode.ERR_EncUpdateFailedMissingSymbol,
Symbols\Tuples\TupleTypeSymbol.cs (1)
300diagnostics.Add(ErrorCode.WRN_TupleLiteralNameMismatch, literal.Arguments[i].Syntax.Parent!.Location, sourceName, destination);
Symbols\TypeSymbol.cs (24)
856diagnostics.Add(ErrorCode.ERR_DuplicateExplicitImpl, implementingType.GetFirstLocation(), interfaceMember); 1010diagnostics.Add(ErrorCode.ERR_ImplicitImplementationOfInaccessibleInterfaceMember, GetImplicitImplementationDiagnosticLocation(interfaceMember, implementingType, implicitImpl), implementingType, interfaceMember, implicitImpl); 1019diagnostics.Add(ErrorCode.ERR_ImplicitImplementationOfNonPublicInterfaceMember, GetImplicitImplementationDiagnosticLocation(interfaceMember, implementingType, implicitImpl), 1071diagnostics.Add(ErrorCode.ERR_MostSpecificImplementationIsNotFound, GetInterfaceLocation(interfaceMember, implementingType), 1629diagnostics.Add(ErrorCode.ERR_RefStructDoesNotSupportDefaultInterfaceImplementationForMember, 1643diagnostics.Add(ErrorCode.ERR_LanguageVersionDoesNotSupportInterfaceImplementationForMember, 1655diagnostics.Add(isStatic ? 1681diagnostics.Add(ErrorCode.ERR_MethodImplementingAccessor, GetImplicitImplementationDiagnosticLocation(interfaceMember, implementingType, implicitImpl), implicitImpl, interfaceMethod, implementingType); 1685diagnostics.Add(ErrorCode.ERR_AccessorImplementingMethod, GetImplicitImplementationDiagnosticLocation(interfaceMember, implementingType, implicitImpl), implicitImpl, interfaceMethod, implementingType); 1694diagnostics.Add(ErrorCode.ERR_InterfaceImplementedByConditional, GetImplicitImplementationDiagnosticLocation(interfaceMember, implementingType, implicitImpl), implicitImpl, interfaceMethod, implementingType); 1698diagnostics.Add(ErrorCode.ERR_InterfaceImplementedByUnmanagedCallersOnlyMethod, GetImplicitImplementationDiagnosticLocation(interfaceMember, implementingType, implicitImpl), implicitImpl, interfaceMethod, implementingType); 1710diagnostics.Add(ErrorCode.ERR_ImplBadTupleNames, GetImplicitImplementationDiagnosticLocation(interfaceMember, implementingType, implicitImpl), implicitImpl, interfaceMember); 1733diagnostics.Add(ErrorCode.WRN_MultipleRuntimeImplementationMatches, GetImplicitImplementationDiagnosticLocation(interfaceMember, implementingType, member), member, interfaceMember, implementingType); 1744diagnostics.Add(ErrorCode.ERR_LanguageVersionDoesNotSupportInterfaceImplementationForMember, 1754diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfacesForMember, 1884diagnostics.Add(ErrorCode.WRN_OverridingDifferentRefness, location, implementingParameter, implementedParameter); 1901diagnostics.Add( 1988diagnostics.Add(closestMismatch.IsStatic ? ErrorCode.ERR_CloseUnimplementedInterfaceMemberStatic : ErrorCode.ERR_CloseUnimplementedInterfaceMemberNotStatic, 1994diagnostics.Add(errorCode, interfaceLocation, implementingType, interfaceMember, closestMismatch); 1998diagnostics.Add(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongInitOnly, interfaceLocation, implementingType, interfaceMember, closestMismatch); 2044diagnostics.Add(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongRefReturn, interfaceLocation, implementingType, interfaceMember, closestMismatch); 2048diagnostics.Add(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongReturnType, interfaceLocation, implementingType, interfaceMember, closestMismatch, interfaceMemberReturnType); 2117diagnostics.Add(ErrorCode.ERR_ImplBadConstraints, GetImplicitImplementationDiagnosticLocation(interfaceMethod, implementingType, implicitImpl), typeParameter2.Name, implicitImpl, typeParameter1.Name, interfaceMethod); 2121diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInConstraintsOnImplicitImplementation, GetImplicitImplementationDiagnosticLocation(interfaceMethod, implementingType, implicitImpl),
Symbols\VarianceSafety.cs (2)
474diagnostics.Add(ErrorCode.ERR_UnexpectedVarianceStaticMember, location, context, unsafeTypeParameter, actualVariance.Localize(), expectedVariance.Localize(), 479diagnostics.Add(ErrorCode.ERR_UnexpectedVariance, location, context, unsafeTypeParameter, actualVariance.Localize(), expectedVariance.Localize());