Version Used:
Branch main (14 Aug 2021)
Latest commit 0954614 by David Barbet:
Merge pull request #55599 from dibarbet/shutdown_jsonrpc_disconnect
Shutdown LSP server on streamjsonrpc disconnect
Steps to Reproduce:
Compile and run the following code
#nullable enable
using System;
using System.Diagnostics.CodeAnalysis;
Func<string?, string> d = ([DisallowNull] string? x) => x;
d(null).ToString();
Expected Behavior:
Warning for the assignment of d since the assigned function doesn't accept null values which are legal as inputs of the delegate
Actual Behavior:
No warnings at all in the program above. The program crashes at runtime with a NullReferenceException