Joe4evr
Joe4evr
> I'm not 100% sure `await? x` will provide much benefit over awaiting a completed task. It's more for cases like `var x = await foo?.SomeTask();` If `foo` turns out...
> My understand that would be a box cast and a heap allocation. Well, HaloFour told you that that isn't the case, so you can stop believing this now.
Curious, would this also be able to work on attribute constructors? ```cs public sealed class Attr : Attribute { public Attr(params ReadOnlySpan values); } // In usage: [Attr(1, 2, 4)]...
> However that particular constructor would not be usable when using the attribute as an annotation on methods, types, etc ... You would still need an array constructor overload for...
> It's very unnatural since anyone would expect the compiler knows which types are needed because all information has been provided already. [Except that's not at all true.](https://blogs.msdn.microsoft.com/ericlippert/2012/03/09/why-not-automatically-infer-constraints/)
> or this is the appropriate place to discuss alternatives to 'closed' types? This is the place to discuss proposals for the C# language and that is a language proposal,...
> 3 is not only useful for structs but also classes. There are already quite a few discussions on const/pure functions. Yeah, even if it only boils down to a...
> I'm proposing that `ImmutableList` is a different type from `ImmutableList`, that would not allow calling methods like `Add` that take `T` as inputs. You'd be able to convert `ImmutableList`...
@hypeartist Because a `ref` is not allowed to live longer than the object it's referring to. If the `ref struct` restriction did not exist, you could end up with `ref`s...
@hamarb123 You can get unscoped behavior with `[UnscopedRef]` (iirc). I believe the reasoning for making that an attribute rather than a keyword is because it's *much* rarer needed.