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