Fix CS8618 suggesting 'required' on events #82424
.NET Result Analysis
Details
Tip
To unconditionally bypass the build analysis check (turn it green), you can use the escape mechanism feature. The completion time may vary, potentially taking several minutes, depending on the build analysis workload at the moment.
Test Failures (17 tests failed)
🔹 [All failing tests from roslyn-CI]
- Exception Message
System.InvalidOperationException : Context: Diagnostics of test state Expected diagnostic id to be "CS8618" was "CS9360"
Expected diagnostic:
// /0/Test0.cs(5,38,5,45): error CS8618
DiagnosticResult.CompilerError("CS8618").WithSpan(5, 38, 5, 45),Actual diagnostic:
// /0/Test0.cs(5,38): error CS9360: Non-nullable event 'MyEvent' must contain a non-null value when exiting constructor. Consider declaring the event as nullable.
DiagnosticResult.CompilerError("CS9360").WithSpan(5, 38, 5, 45).WithSpan(5, 38, 5, 45).WithArguments("event", "MyEvent"),- CallStack
at Microsoft.CodeAnalysis.Testing.DefaultVerifier.Equal[T](T expected, T actual, String message) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/DefaultVerifier.cs:line 79 at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.VerifyDiagnosticResults(IEnumerable`1 actualResults, ImmutableArray`1 analyzers, DiagnosticResult[] expectedResults, IVerifier verifier) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 605 at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.<VerifyDiagnosticsAsync>d__68.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 451 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() at Microsoft.CodeAnalysis.Testing.CodeFixTest`1.<RunImplAsync>d__44.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.CodeFix.Testing/CodeFixTest`1.cs:line 311 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions.CSharpCodeFixVerifier`2.Test.<RunImplAsync>d__26.MoveNext() in /_/src/Features/DiagnosticsTestUtilities/CodeActions/CSharpCodeFixVerifier`2+Test.cs:line 93 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.<RunAsync>d__62.MoveNext() in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 174 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
❌ Microsoft.CodeAnalysis.CSharp.Analyzers.UnitTests.MakeMemberRequired.MakeMemberRequiredTests.NotOnEventDeclaration [Console] [Details] [Artifacts] [0.26% failure rate]
-
[ 🚧 Report test infrastructure issue] [ 📄 Report test repository issue]
Failing Configurations (5)
❌ workitem_0.WorkItemExecution [Console] [Details] [Artifacts] [0.94% failure rate]
-
[ 🚧 Report test infrastructure issue] [ 📄 Report test repository issue]
This is a helix work item crash with status: BadExit. To investigate look the [Console log] / navigate to [Helix Artifacts]
❌ workitem_3.WorkItemExecution [Console] [Details] [Artifacts] [1.13% failure rate]
-
[ 🚧 Report test infrastructure issue] [ 📄 Report test repository issue]
This is a helix work item crash with status: BadExit. To investigate look the [Console log] / navigate to [Helix Artifacts]
Failing Configuration
❌ workitem_5.WorkItemExecution [Console] [Details] [Artifacts] [0.48% failure rate]
-
[ 🚧 Report test infrastructure issue] [ 📄 Report test repository issue]
This is a helix work item crash with status: BadExit. To investigate look the [Console log] / navigate to [Helix Artifacts]
❌ workitem_6.WorkItemExecution [Console] [Details] [Artifacts] [1.29% failure rate]
-
[ 🚧 Report test infrastructure issue] [ 📄 Report test repository issue]
This is a helix work item crash with status: DeadLetter. To investigate look the [Console log] / navigate to [Helix Artifacts]