Skip to content

[Proposal]: User-defined positional patterns #8613

@333fred

Description

@333fred

User-defined positional patterns

Summary

Defining a named positional pattern which is not bound to a type check.

Exploring a different approach than the one originally presented in #1047 which suggests to relax Deconstruct to return bool.

This proposal does not conflict with bool-returning Deconstruct methods, i.e. both can exist at the same time, but this enables much more flexibility in this space as these patterns have a name of their own rather than just using the type's name.

Design meetings

https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-02-16.md#user-defined-positional-patterns

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions