3 ms·
Thing is, in most cases, you don't want to do that. You just want to narrow the type. It's unfortunate that this isn't readily possible even by explicitly reus
by int_19h 10y ago
Thing is, in most cases, you don't want to do that. You just want to narrow the type.
It's unfortunate that this isn't readily possible even by explicitly reusing the name - C# shadowing rules for locals preclude it. So you can't do something like `if (x is int x) { ... }`.