65 references to Add
Microsoft.CodeAnalysis.CSharp (65)
Binder\Binder_Symbols.cs (1)
2813
diagnostics?.
Add
(ErrorCode.WRN_ErrorOverride, getLocation(data), diagInfo, (int)diagInfo.Code);
Compilation\CSharpCompilation.cs (2)
3523
diagnostics.
Add
(ErrorCode.ERR_ModuleEmitFailure, NoLocation.Singleton, ((Cci.INamedEntity)moduleBeingBuilt).Name,
3663
_diagnostics.
Add
(ErrorCode.ERR_FileTypeNonUniquePath, location, symbol, filePath);
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (6)
304
includeDiagnostics.
Add
(ErrorCode.WRN_InvalidInclude, location, subMessage);
315
includeDiagnostics.
Add
(ErrorCode.WRN_FailedInclude, location, filePathValue, xpathValue, new CodeAnalysisResourcesLocalizableErrorArgument(nameof(CodeAnalysisResources.XmlReferencesNotSupported)));
325
includeDiagnostics.
Add
(ErrorCode.WRN_FailedInclude, location, filePathValue, xpathValue, new CodeAnalysisResourcesLocalizableErrorArgument(nameof(CodeAnalysisResources.FileNotFound)));
346
includeDiagnostics.
Add
(ErrorCode.WRN_FailedInclude, location, filePathValue, xpathValue, e.Message);
358
includeDiagnostics.
Add
(ErrorCode.WRN_FailedInclude, location, filePathValue, xpathValue, errorMessage);
405
includeDiagnostics.
Add
(ErrorCode.WRN_XMLParseIncludeError, errorLocation, GetDescription(e)); //NOTE: location is in included file.
Emitter\EditAndContinue\EmitHelpers.cs (2)
108
diagnostics.
Add
(ErrorCode.ERR_ModuleEmitFailure, NoLocation.Singleton, compilation.AssemblyName, e.Message);
173
diagnostics.
Add
(
Emitter\Model\AttributeDataAdapter.cs (1)
46
context.Diagnostics.
Add
(ErrorCode.ERR_NotAnAttributeClass, context.Location ?? NoLocation.Singleton, this.AttributeClass);
Emitter\Model\PEModuleBuilder.cs (5)
695
diagnostics.
Add
(ErrorCode.ERR_ExportedTypeConflictsWithDeclaration, NoLocation.Singleton, type, type.ContainingModule);
699
diagnostics.
Add
(ErrorCode.ERR_ForwardedTypeConflictsWithDeclaration, NoLocation.Singleton, type);
715
diagnostics.
Add
(ErrorCode.ERR_ExportedTypesConflict, NoLocation.Singleton, type, type.ContainingModule, contender, contender.ContainingModule);
720
diagnostics.
Add
(ErrorCode.ERR_ForwardedTypeConflictsWithExportedType, NoLocation.Singleton, type, type.ContainingAssembly, contender, contender.ContainingModule);
725
diagnostics.
Add
(ErrorCode.ERR_ForwardedTypesConflict, NoLocation.Singleton, type, type.ContainingAssembly, contender, contender.ContainingAssembly);
Errors\MessageProvider.cs (5)
207
diagnostics.
Add
(ErrorCode.ERR_DuplicateImport, location,
214
diagnostics.
Add
(ErrorCode.ERR_DuplicateImportSimple, location,
263
diagnostics.
Add
(ErrorCode.ERR_InvalidAttributeArgument, ((CSharpAttributeData)attribute).GetAttributeArgumentLocation(parameterIndex), node.GetErrorDisplayName());
280
diagnostics.
Add
(ErrorCode.ERR_MarshalUnmanagedTypeNotValidForFields, ((CSharpAttributeData)attribute).GetAttributeArgumentLocation(parameterIndex), unmanagedTypeName);
285
diagnostics.
Add
(ErrorCode.ERR_MarshalUnmanagedTypeOnlyValidForFields, ((CSharpAttributeData)attribute).GetAttributeArgumentLocation(parameterIndex), unmanagedTypeName);
FlowAnalysis\ControlFlowPass.cs (2)
219
Diagnostics.
Add
(ErrorCode.ERR_LabelNotFound, loc, ((BoundGotoStatement)pending.Branch).Label.Name);
379
Diagnostics.
Add
(isLastSection ? ErrorCode.ERR_SwitchFallOut : ErrorCode.ERR_SwitchFallThrough,
FlowAnalysis\DefiniteAssignment.cs (18)
498
Diagnostics.
Add
(
505
Diagnostics.
Add
(
523
Diagnostics.
Add
(ErrorCode.ERR_ParamUnassigned, location, parameter.Name);
542
Diagnostics.
Add
(ErrorCode.ERR_ParamUnassigned, location, parameter.Name);
627
diagnostics.
Add
(newCode, diagnostic.Location, args);
694
diagnostics.
Add
(ErrorCode.ERR_LocalCantBeFixedAndHoisted, location, captured.Name);
1243
Diagnostics.
Add
(ErrorCode.ERR_UseDefViolationOut, node.Location, symbolName);
1248
Diagnostics.
Add
(ErrorCode.ERR_UseDefViolation, node.Location, symbolName);
1300
Diagnostics.
Add
(
1314
Diagnostics.
Add
(hasAssociatedProperty ? ErrorCode.ERR_UseDefViolationProperty : ErrorCode.ERR_UseDefViolationField, node.Location, symbolName);
1324
Diagnostics.
Add
(hasAssociatedProperty ? ErrorCode.ERR_UseDefViolationProperty : ErrorCode.ERR_UseDefViolationField, node.Location, symbolName);
1340
Diagnostics.
Add
(
1348
Diagnostics.
Add
(
1355
Diagnostics.
Add
(
1963
Diagnostics.
Add
((primaryCtor.ContainingType is { IsRecord: true } or { IsRecordStruct: true }) ?
2332
Diagnostics.
Add
(assigned && _writtenVariables.Contains(symbol) ? ErrorCode.WRN_UnreferencedVarAssg : ErrorCode.WRN_UnreferencedVar, symbol.GetFirstLocationOrNone(), symbol.Name);
2351
Diagnostics.
Add
(ErrorCode.WRN_UnreferencedLocalFunction, symbol.GetFirstLocationOrNone(), symbol.Name);
2380
Diagnostics.
Add
(ErrorCode.ERR_FixedLocalInLambda, new SourceLocation(node.Syntax), localSymbol);
FlowAnalysis\NullableWalker.cs (7)
1074
Diagnostics.
Add
(ErrorCode.WRN_MemberNotNull, syntax.GetLocation(), member.Name);
1143
Diagnostics.
Add
(ErrorCode.WRN_MemberNotNullWhen, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation(), member.Name, sense ? "true" : "false");
1315
Diagnostics.
Add
(ErrorCode.WRN_ParameterDisallowsNull, location, parameter.Name);
1342
Diagnostics.
Add
(ErrorCode.WRN_ParameterConditionallyDisallowsNull, syntax.Location, parameter.Name, sense ? "true" : "false");
1401
Diagnostics.
Add
(ErrorCode.WRN_ParameterNotNullIfNotNull, location, outputParam.Name, inputParam.Name);
1406
Diagnostics.
Add
(ErrorCode.WRN_ReturnNotNullIfNotNull, location, inputParam.Name);
2686
Diagnostics.
Add
(errorCode, location, arguments);
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (1)
701
_diagnostics.
Add
(ErrorCode.ERR_SpecialByRefInLambda, syntax.Location, type);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (2)
87
diagnostics.
Add
(ErrorCode.ERR_ByRefTypeAndAwait, syntax.Location, local.TypeWithAnnotations);
105
diagnostics.
Add
(ErrorCode.ERR_ByRefTypeAndAwait, syntax.Location, parameter.TypeWithAnnotations);
Symbols\AssemblySymbol.cs (1)
1001
warnings.
Add
(ErrorCode.WRN_MultiplePredefTypes, NoLocation.Singleton, result, result.ContainingAssembly);
Symbols\ReferenceManager.cs (1)
106
diagnostics.
Add
(ErrorCode.ERR_AssemblySpecifiedForLinkAndRef, NoLocation.Singleton, duplicateReference.Display, primaryReference.Display);
Symbols\Source\ModifierUtils.cs (1)
477
diagnostics.
Add
(
Symbols\Source\SourceAssemblySymbol.cs (5)
2737
diagnostics.
Add
(ErrorCode.WRN_UnreferencedEvent, associatedPropertyOrEvent.GetFirstLocationOrNone(), associatedPropertyOrEvent);
2742
diagnostics.
Add
(ErrorCode.WRN_UnreferencedField, field.GetFirstLocationOrNone(), field);
2746
diagnostics.
Add
(ErrorCode.WRN_UnassignedInternalRefField, field.GetFirstLocationOrNone(), field);
2750
diagnostics.
Add
(ErrorCode.WRN_UnassignedInternalField, field.GetFirstLocationOrNone(), field, DefaultValue(field.Type));
2770
diagnostics.
Add
(ErrorCode.WRN_UnreferencedFieldAssg, field.GetFirstLocationOrNone(), field);
Symbols\Source\SourceMemberContainerSymbol.cs (1)
515
diagnostics.
Add
(ErrorCode.WRN_LowerCaseTypeName, location, name);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (4)
301
diagnostics.
Add
(ErrorCode.ERR_DuplicateAlias, pair.Value.Alias.GetFirstLocation(), pair.Key);
370
diagnostics.
Add
(ErrorCode.ERR_DuplicateAlias, externAlias.Alias.GetFirstLocation(), externAlias.Alias.Name);
492
diagnostics.
Add
(ErrorCode.ERR_DuplicateAlias, existingAlias.Alias.GetFirstLocation(), existingAlias.Alias.Name);
688
diagnostics.
Add
(ErrorCode.ERR_DuplicateAlias, location, identifierValueText);