Closed Gnbrkm41 closed 4 years ago
I think this is by design (@jcouv to confirm). You're assigning "ayy lmao", so the value isn't actually null. If you actually use null, you'll see this as string?
(int? ayy, string? lmao) tuple = (42, null);
var (ayy, lmao) = tuple;
Related: https://github.com/dotnet/corefx/issues/42463
Version Used: VS2019 Community Preview 16.4 P4 (
Compiler version: '3.4.0-beta3-19554-05 (
0c5378aa)'. Language version: default.
). Also reproduced on the LINQPad 6.4.4 (Compiler version: '3.3.1-beta4-19462-11 (
66a912c9)'. Language version: preview.
)Steps to Reproduce:
namespace ConsoleApp19 { class Program { static void Main(string[] args) { (int? ayy, string? lmao) tuple = (42, "ayy lmao"); var (ayy, lmao) = tuple; // Alternatively: // (int? ayy, string? lmao) = tuple; } } }