Skip to content

Pattern matching (switch expression) for Tuples (.Case) #939

Discussion options

You must be logged in to vote

Ok, after fiddling with ToNullable() and with refactoring tipps by Rider (ReSharper) I found a working solution:

Assert.True(set.FindExactOrSuccessor(DateTimeOffset.MinValue).Case is (DateTimeOffset a1, int b1) && b1 == 42);
Assert.True(set.FindExactOrSuccessor(DateTimeOffset.MinValue).Case is (DateTimeOffset a2, int b2 and 42));

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by StefanBertels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant