David Arno
David Arno
@Thaina, Sure, `var a = c switch { true => 1, false => null };` should reasonably be expected to result in `a` being a `?int` under proposals to support...
@Thaina, ~~That's a fair point. Perhaps therefore `var a = switch { true => x = 1, false => s = null };` could result in `a` being a `?int`.~~...
@ronnygunawan, Blocks aren't statement expressions, so allowing them within a switch expression would be beyond the scope of what's proposed for #2860 I personally remain unconvinced of the benefits of...
@HaloFour, > And local functions require you to move the logic of the operation away from where it's intended to be used. At the risk of indulging in a reductio...
@yaakov-h, As @mattwar says, `()` is another way of saying `unit`, ie no value. However, I feel it would be a bad idea to introduce yet another type (`unit`) to...
@quinmars, I agree that a real unit type would be useful. If it's feasible though, then I'd like to see `void` become that unit type, so that I could do...
@0xd4d, > There must be a way to convert an integer to the closed enum (unsafe code). Why? I see no reason for closed enums to have any sort of...
@dsaf, existing enums are already open. For: ```cs enum Shape { Point, Rectangle, Shape } ``` `Shape` can take any `int` value. `Point`, `Rectangle`, and `Shape` are little more than...
@alrz, "compiler magic" suits me. It's then @gafter's job to solve how to have struct-based DUs (including closed enums) work with `a is X b`, rather than mine 👍 @0xd4d,...
> ... if you are only using 2 out of 20 values, then you effectively have open use of a closed enum; you're already saying i don't care if new...