50 references to Add
Microsoft.CodeAnalysis.CSharp (50)
Binder\Binder_Symbols.cs (1)
2765
diagnostics?.
Add
(ErrorCode.WRN_ErrorOverride, getLocation(data), diagInfo, (int)diagInfo.Code);
Compilation\CSharpCompilation.cs (2)
3499
diagnostics.
Add
(ErrorCode.ERR_ModuleEmitFailure, NoLocation.Singleton, ((Cci.INamedEntity)moduleBeingBuilt).Name,
3616
_diagnostics.
Add
(ErrorCode.ERR_FileTypeNonUniquePath, location, symbol, filePath);
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (4)
304
includeDiagnostics.
Add
(ErrorCode.WRN_InvalidInclude, location, subMessage);
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 (1)
171
diagnostics.
Add
(
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,
261
diagnostics.
Add
(ErrorCode.ERR_InvalidAttributeArgument, ((CSharpAttributeData)attribute).GetAttributeArgumentLocation(parameterIndex), node.GetErrorDisplayName());
278
diagnostics.
Add
(ErrorCode.ERR_MarshalUnmanagedTypeNotValidForFields, ((CSharpAttributeData)attribute).GetAttributeArgumentLocation(parameterIndex), unmanagedTypeName);
283
diagnostics.
Add
(ErrorCode.ERR_MarshalUnmanagedTypeOnlyValidForFields, ((CSharpAttributeData)attribute).GetAttributeArgumentLocation(parameterIndex), unmanagedTypeName);
FlowAnalysis\DefiniteAssignment.cs (16)
489
Diagnostics.
Add
(
496
Diagnostics.
Add
(
514
Diagnostics.
Add
(ErrorCode.ERR_ParamUnassigned, location, parameter.Name);
533
Diagnostics.
Add
(ErrorCode.ERR_ParamUnassigned, location, parameter.Name);
693
diagnostics.
Add
(ErrorCode.ERR_LocalCantBeFixedAndHoisted, location, captured.Name);
1242
Diagnostics.
Add
(ErrorCode.ERR_UseDefViolationOut, node.Location, symbolName);
1247
Diagnostics.
Add
(ErrorCode.ERR_UseDefViolation, node.Location, symbolName);
1299
Diagnostics.
Add
(
1313
Diagnostics.
Add
(hasAssociatedProperty ? ErrorCode.ERR_UseDefViolationProperty : ErrorCode.ERR_UseDefViolationField, node.Location, symbolName);
1323
Diagnostics.
Add
(hasAssociatedProperty ? ErrorCode.ERR_UseDefViolationProperty : ErrorCode.ERR_UseDefViolationField, node.Location, symbolName);
1339
Diagnostics.
Add
(
1347
Diagnostics.
Add
(
1354
Diagnostics.
Add
(
1950
Diagnostics.
Add
((primaryCtor.ContainingType is { IsRecord: true } or { IsRecordStruct: true }) ?
2327
Diagnostics.
Add
(assigned && _writtenVariables.Contains(symbol) ? ErrorCode.WRN_UnreferencedVarAssg : ErrorCode.WRN_UnreferencedVar, symbol.GetFirstLocationOrNone(), symbol.Name);
2346
Diagnostics.
Add
(ErrorCode.WRN_UnreferencedLocalFunction, symbol.GetFirstLocationOrNone(), symbol.Name);
FlowAnalysis\NullableWalker.cs (7)
1055
Diagnostics.
Add
(ErrorCode.WRN_MemberNotNull, syntax.GetLocation(), member.Name);
1124
Diagnostics.
Add
(ErrorCode.WRN_MemberNotNullWhen, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation(), member.Name, sense ? "true" : "false");
1283
Diagnostics.
Add
(ErrorCode.WRN_ParameterDisallowsNull, location, parameter.Name);
1310
Diagnostics.
Add
(ErrorCode.WRN_ParameterConditionallyDisallowsNull, syntax.Location, parameter.Name, sense ? "true" : "false");
1369
Diagnostics.
Add
(ErrorCode.WRN_ParameterNotNullIfNotNull, location, outputParam.Name, inputParam.Name);
1374
Diagnostics.
Add
(ErrorCode.WRN_ReturnNotNullIfNotNull, location, inputParam.Name);
2643
Diagnostics.
Add
(errorCode, location, arguments);
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (1)
701
_diagnostics.
Add
(ErrorCode.ERR_SpecialByRefInLambda, syntax.Location, type);
Symbols\ReferenceManager.cs (1)
107
diagnostics.
Add
(ErrorCode.ERR_AssemblySpecifiedForLinkAndRef, NoLocation.Singleton, duplicateReference.Display, primaryReference.Display);
Symbols\Source\ModifierUtils.cs (1)
451
diagnostics.
Add
(
Symbols\Source\SourceAssemblySymbol.cs (5)
2736
diagnostics.
Add
(ErrorCode.WRN_UnreferencedEvent, associatedPropertyOrEvent.GetFirstLocationOrNone(), associatedPropertyOrEvent);
2741
diagnostics.
Add
(ErrorCode.WRN_UnreferencedField, field.GetFirstLocationOrNone(), field);
2745
diagnostics.
Add
(ErrorCode.WRN_UnassignedInternalRefField, field.GetFirstLocationOrNone(), field);
2749
diagnostics.
Add
(ErrorCode.WRN_UnassignedInternalField, field.GetFirstLocationOrNone(), field, DefaultValue(field.Type));
2769
diagnostics.
Add
(ErrorCode.WRN_UnreferencedFieldAssg, field.GetFirstLocationOrNone(), field);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
688
diagnostics.
Add
(ErrorCode.ERR_DuplicateAlias, location, identifierValueText);