86 references to ErrorFacts
Microsoft.CodeAnalysis.CSharp (44)
Binder\Binder_Lambda.cs (1)
298
diagnostics.Add(
ErrorFacts
.GetStaticClassReturnCode(useWarning: false), syntax.Location, type);
Binder\Binder_Statements.cs (2)
2129
Error(diagnostics,
ErrorFacts
.GetStaticClassParameterCode(useWarning: false), anonymousFunction.ParameterLocation(i), delegateParameters[i].Type);
2183
Debug.Assert(
ErrorFacts
.PreventsSuccessfulDelegateConversion(bindingResult.Diagnostics.Diagnostics));
Binder\Semantics\Conversions\ConversionsBase.cs (1)
1502
if (
ErrorFacts
.PreventsSuccessfulDelegateConversion(bound.Diagnostics.Diagnostics))
BoundTree\UnboundLambda.cs (2)
823
if (IsAsync && !
ErrorFacts
.PreventsSuccessfulDelegateConversion(diagnostics.DiagnosticBag))
1327
if (
ErrorFacts
.PreventsSuccessfulDelegateConversion((ErrorCode)diagnostic.Code))
CommandLine\CSharpCommandLineParser.cs (2)
2085
foreach (var errorCode in
ErrorFacts
.NullableWarnings)
2097
ErrorFacts
.IsWarning((ErrorCode)number))
CommandLine\CSharpCompiler.cs (5)
277
consoleOutput.WriteLine(
ErrorFacts
.GetMessage(MessageID.IDS_LogoLine1, Culture), GetToolName(), GetCompilerVersion());
278
consoleOutput.WriteLine(
ErrorFacts
.GetMessage(MessageID.IDS_LogoLine2, Culture));
284
consoleOutput.WriteLine(
ErrorFacts
.GetMessage(MessageID.IDS_LangVersions, Culture));
316
return
ErrorFacts
.GetMessage(MessageID.IDS_ToolName, Culture);
325
consoleOutput.WriteLine(
ErrorFacts
.GetMessage(MessageID.IDS_CSCHelp, Culture));
Compilation\CSharpCompilerDiagnosticAnalyzer.cs (1)
35
if (!
ErrorFacts
.IsBuildOnlyDiagnostic(errorCode) &&
Compilation\CSharpDiagnosticFilter.cs (3)
78
reportAction = GetDiagnosticReport(
ErrorFacts
.GetSeverity(ErrorCode.WRN_ALinkWarn),
81
ErrorFacts
.GetWarningLevel(ErrorCode.WRN_ALinkWarn),
149
bool isNullableFlowAnalysisWarning =
ErrorFacts
.NullableWarnings.Contains(id);
Compiler\DocumentationCommentCompiler.cs (2)
291
string message =
ErrorFacts
.GetMessage(MessageID.IDS_XMLIGNORED, CultureInfo.CurrentUICulture);
341
string message =
ErrorFacts
.GetMessage(MessageID.IDS_XMLIGNORED, CultureInfo.CurrentUICulture);
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (3)
286
commentMessage =
ErrorFacts
.GetMessage(MessageID.IDS_XMLNOINCLUDE, CultureInfo.CurrentUICulture);
409
commentMessage = string.Format(
ErrorFacts
.GetMessage(MessageID.IDS_XMLIGNORED2, CultureInfo.CurrentUICulture), resolvedFilePath);
438
return
ErrorFacts
.GetMessage(messageId, CultureInfo.CurrentUICulture);
Errors\ErrorFacts.cs (5)
148
return new LocalizableResourceString(code.ToString(), ResourceManager, typeof(
ErrorFacts
));
153
return new LocalizableResourceString(code.ToString() + s_titleSuffix, ResourceManager, typeof(
ErrorFacts
));
158
return new LocalizableResourceString(code.ToString() + s_descriptionSuffix, ResourceManager, typeof(
ErrorFacts
));
2365
if (
ErrorFacts
.PreventsSuccessfulDelegateConversion((ErrorCode)diag.Code))
2378
if (
ErrorFacts
.PreventsSuccessfulDelegateConversion((ErrorCode)diag.Code))
Errors\MessageID.cs (1)
288
return
ErrorFacts
.GetMessage(_id, formatProvider as System.Globalization.CultureInfo);
Errors\MessageProvider.cs (8)
39
return
ErrorFacts
.GetSeverity((ErrorCode)code);
44
return
ErrorFacts
.GetMessage((ErrorCode)code, language);
49
return
ErrorFacts
.GetMessageFormat((ErrorCode)code);
54
return
ErrorFacts
.GetDescription((ErrorCode)code);
59
return
ErrorFacts
.GetTitle((ErrorCode)code);
64
return
ErrorFacts
.GetHelpLink((ErrorCode)code);
69
return
ErrorFacts
.GetCategory((ErrorCode)code);
91
return
ErrorFacts
.GetWarningLevel((ErrorCode)code);
Errors\XmlSyntaxDiagnosticInfo.cs (1)
62
string message =
ErrorFacts
.GetMessage(_xmlErrorCode, culture);
FlowAnalysis\NullableWalker.cs (1)
2512
Debug.Assert(
ErrorFacts
.NullableWarnings.Contains(MessageProvider.Instance.GetIdForErrorCode((int)errorCode)));
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
79
diagnostics.Add(
ErrorFacts
.GetStaticClassReturnCode(useWarning: false), returnTypeParameter.Location, returnType);
Symbols\Source\ParameterHelpers.cs (1)
649
ErrorFacts
.GetStaticClassParameterCode(containingSymbol?.ContainingType?.IsInterfaceType() ?? false),
Symbols\Source\SourceOrdinaryMethodSymbolBase.cs (1)
369
diagnostics.Add(
ErrorFacts
.GetStaticClassReturnCode(ContainingType.IsInterfaceType()), location, ReturnType);
Symbols\Source\SourcePropertySymbolBase.cs (2)
1540
diagnostics.Add(
ErrorFacts
.GetStaticClassReturnCode(ContainingType.IsInterfaceType()), TypeLocation, type);
1545
diagnostics.Add(
ErrorFacts
.GetStaticClassParameterCode(ContainingType.IsInterfaceType()), TypeLocation, type);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
264
diagnostics.Add(
ErrorFacts
.GetStaticClassReturnCode(useWarning: false), returnTypeSyntax.Location, returnType.Type);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (8)
CommandLineTests.cs (8)
3258
Assert.Equal(expected:
ErrorFacts
.NullableWarnings.Count + 2, actual: arguments.CompilationOptions.SpecificDiagnosticOptions.Count);
3260
foreach (string warning in
ErrorFacts
.NullableWarnings)
3291
Assert.Equal(expected:
ErrorFacts
.NullableWarnings.Count + 2, actual: arguments.CompilationOptions.SpecificDiagnosticOptions.Count);
3293
foreach (string warning in
ErrorFacts
.NullableWarnings)
3324
Assert.Equal(expected:
ErrorFacts
.NullableWarnings.Count + 3, actual: arguments.CompilationOptions.SpecificDiagnosticOptions.Count);
3326
foreach (string warning in
ErrorFacts
.NullableWarnings)
3358
Assert.Equal(expected:
ErrorFacts
.NullableWarnings.Count + 2, actual: arguments.CompilationOptions.SpecificDiagnosticOptions.Count);
3360
foreach (string warning in
ErrorFacts
.NullableWarnings)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
Emit\NumericIntPtrTests.cs (3)
2376
if (expectedError == null ||
ErrorFacts
.IsWarning((ErrorCode)expectedError.Code))
8983
if (expectedDiagnostics.Any(d =>
ErrorFacts
.GetSeverity((ErrorCode)d.Code) == DiagnosticSeverity.Error))
9028
if (expectedDiagnostics.Any(d =>
ErrorFacts
.GetSeverity((ErrorCode)d.Code) == DiagnosticSeverity.Error))
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\NativeIntegerTests.cs (3)
6521
if (expectedError == null ||
ErrorFacts
.IsWarning((ErrorCode)expectedError.Code))
13241
if (expectedDiagnostics.Any(d =>
ErrorFacts
.GetSeverity((ErrorCode)d.Code) == DiagnosticSeverity.Error))
13284
if (expectedDiagnostics.Any(d =>
ErrorFacts
.GetSeverity((ErrorCode)d.Code) == DiagnosticSeverity.Error))
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Compilation\UsedAssembliesTests.cs (1)
109
if (!after.Any(d =>
ErrorFacts
.GetSeverity((ErrorCode)d.Code) == DiagnosticSeverity.Error))
Symbols\TypeTests.cs (1)
1178
Assert.Equal(0, comp.GetDeclarationDiagnostics().Count(diag => !
ErrorFacts
.IsWarning((ErrorCode)diag.Code)));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (26)
Diagnostics\DiagnosticTest.cs (26)
46
Assert.False(string.IsNullOrEmpty(
ErrorFacts
.GetMessage(code, CultureInfo.InvariantCulture)), $"Message for error {code} is null or empty.");
219
Assert.True(
ErrorFacts
.IsWarning(errorCode));
220
Assert.NotEqual(0,
ErrorFacts
.GetWarningLevel(errorCode));
224
Assert.False(
ErrorFacts
.IsWarning(errorCode));
225
Assert.Equal(0,
ErrorFacts
.GetWarningLevel(errorCode));
236
Assert.Equal(2,
ErrorFacts
.GetWarningLevel(ErrorCode.WRN_DeprecatedCollectionInitAddStr));
237
Assert.Equal(1,
ErrorFacts
.GetWarningLevel(ErrorCode.WRN_DefaultValueForUnconsumedLocation));
238
Assert.Equal(2,
ErrorFacts
.GetWarningLevel(ErrorCode.WRN_UnmatchedParamRefTag));
239
Assert.Equal(2,
ErrorFacts
.GetWarningLevel(ErrorCode.WRN_UnmatchedTypeParamRefTag));
240
Assert.Equal(1,
ErrorFacts
.GetWarningLevel(ErrorCode.WRN_ReferencedAssemblyReferencesLinkedPIA));
241
Assert.Equal(2,
ErrorFacts
.GetWarningLevel(ErrorCode.WRN_DynamicDispatchToConditionalMethod));
242
Assert.Equal(3,
ErrorFacts
.GetWarningLevel(ErrorCode.WRN_IsDynamicIsConfusing));
243
Assert.Equal(2,
ErrorFacts
.GetWarningLevel(ErrorCode.WRN_NoSources));
257
Assert.True(
ErrorFacts
.IsWarning(errorCode));
307
Assert.Equal(1,
ErrorFacts
.GetWarningLevel(errorCode));
312
Assert.Equal(2,
ErrorFacts
.GetWarningLevel(errorCode));
317
Assert.Equal(3,
ErrorFacts
.GetWarningLevel(errorCode));
411
Assert.Equal(1,
ErrorFacts
.GetWarningLevel(errorCode));
414
Assert.Equal(4,
ErrorFacts
.GetWarningLevel(errorCode));
433
Assert.Equal(5,
ErrorFacts
.GetWarningLevel(errorCode));
437
Assert.Equal(6,
ErrorFacts
.GetWarningLevel(errorCode));
441
Assert.Equal(7,
ErrorFacts
.GetWarningLevel(errorCode));
445
Assert.Equal(8,
ErrorFacts
.GetWarningLevel(errorCode));
450
Assert.True(false, $"Please update this test case with a proper warning level ({
ErrorFacts
.GetWarningLevel(errorCode)}) for '{errorCodeName}'");
473
if (
ErrorFacts
.NullableWarnings.Contains(MessageProvider.Instance.GetIdForErrorCode((int)error)))
2904
var isBuildOnly =
ErrorFacts
.IsBuildOnlyDiagnostic(errorCode);