Skip to content

[C# 15-Reference]: New Feature - Closed class hierarchies #54013

@BillWagner

Description

@BillWagner

.NET 11 Preview

.NET 11 Preview 5

Link to speclet

Link to Pull request

New behavior

An abstract class may include the closed modifier. This means that direct derived classes are only allowed in the same assembly. The result is that exhaustiveness can be tracked to that set of derived classes.

Language reference tasks

  • A new article should describe the closed modifier.
  • Articles on pattern matching exhaustiveness should include a discussion of closed hierarchies.
  • Records should also discuss the potential for closed hierarchies.

I'll add a second issue for fundamentals because we don't want to have preview features in fundamentals.

Everyday C# tasks

No response


Associated WorkItem - 582357

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

🔖 Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions