UPDATE: Okay so the correct syntax, assuming you have a variable

B3? b;

and B3 is a value type such as a struct, is

if (b is B3 _b) {
// Non-null variable named _b now exists
}

However I also just in replies learned something WILD, which is if you don't remember or don't want to type the name of B3, you can just type

if (b is { } _b) {
// Non-null variable named _b now exists
}

and the compiler accepts that just fine and does the right thing. What on *earth*. C# is simply too big

0

If you have a fediverse account, you can quote this note from your own instance. Search https://60228.dev/users/leo/statuses/114825115018748924 on your instance and quote it. (Note that quoting is not supported in Mastodon.)