C#C
C#6mo ago
Happypig375

✅ When is the single argument positional pattern ever used?

var a = new Type() is Type(var y);
class Type {
    public void Deconstruct(out int x) => x = 1;
}

The Type(var y) is what I'm looking for. There is no equivalent for deconstruction (var (y) = new Type() is invalid). Does there exist any .NET API that even makes use of this? Is it ever good design compared to property patterns??
Was this page helpful?