© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•8mo ago•
16 replies
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;
}
var a = new Type() is Type(var y);
class Type {
    public void Deconstruct(out int x) => x = 1;
}

The
Type(var y)
Type(var y)
is what I'm looking for. There is no equivalent for deconstruction (
var (y) = new Type()
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??
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Is System.Half ever used?
C#CC# / help
3y ago
✅ positional parameters
C#CC# / help
2y ago
anybody here ever used geany?
C#CC# / help
3y ago
ArgumentNullException when argument is not null
C#CC# / help
4y ago