Repository navigation
[Version 11.0] Feature support for static abstract members in interfaces - #1609
Draft
RexJaeschke wants to merge 8 commits into
Draft
RexJaeschke wants to merge 8 commits into
RexJaeschke wants to merge 8 commits into
Conversation
RexJaeschke
marked this pull request as draft
March 17, 2026 17:58
RexJaeschke
commented
Mar 17, 2026
| It is a compile-time error if *constant_expression*is `double.NaN`, `float.NaN`, or `null_literal`. | ||
|
|
||
| When the input value has a type for which a suitable built-in binary relational operator is defined, the evaluation of that operator is taken as the meaning of the relational pattern. Otherwise, the input value is converted to the type of `constant_expression` using an explicit nullable or unboxing conversion. It is a compile-time error if no such conversion exists. The pattern is considered to not match if the conversion fails. If the conversion succeeds, the result of the pattern-matching operation is the result of evaluating the expression `e «op» v` where `e` is the converted input, «op» is the relational operator, and `v` is the `constant_expression`. | ||
| When the input value has a type for which a suitable built-in binary relational operator is defined, the evaluation of that operator is taken as the meaning of the relational pattern. Otherwise, the input value is converted to the type of *constant_expression* using an explicit nullable or unboxing conversion. It is a compile-time error if no such conversion exists. It is a compile-time error if the input type is a type parameter constrained to, or a type inheriting, from `System.Numerics.INumberBase<T>` and the input type has no suitable built-in binary relational operator defined. The pattern is considered to not match if the conversion fails. If the conversion succeeds, the result of the pattern-matching operation is the result of evaluating the expression `e «op» v` where `e` is the converted input, «op» is the relational operator, and `v` is the *constant_expression*. |
Contributor
Author
There was a problem hiding this comment.
This is the first mention of the type System.Numerics.INumberBase<T> in the spec. Unless we are going to add all the machinery about that type and how built-in numeric types now have that as a base interface, we'll need some alternative wording here.
BillWagner
force-pushed
the
v11-static-abstract-members-in-interfaces
branch
from
April 29, 2026 19:28
1ad0292 to
714489d
Compare
BillWagner
force-pushed
the
v11-static-abstract-members-in-interfaces
branch
from
May 13, 2026 16:37
ccd696c to
b4f5feb
Compare
BillWagner
force-pushed
the
v11-static-abstract-members-in-interfaces
branch
from
June 24, 2026 20:14
b4f5feb to
ccf9875
Compare
Member
|
An earlier version of this feature is already present on |
BillWagner
force-pushed
the
v11-static-abstract-members-in-interfaces
branch
from
July 24, 2026 19:57
ccf9875 to
ad2ed21
Compare
BillWagner
force-pushed
the
v11-static-abstract-members-in-interfaces
branch
4 times, most recently
from
September 21, 2026 19:20
1ad750c to
34a2823
Compare
BillWagner
force-pushed
the
v11-static-abstract-members-in-interfaces
branch
from
October 14, 2026 18:11
34a2823 to
e620b60
Compare
BillWagner
added a commit
that referenced
this pull request
Oct 14, 2026
Preserve all sixteen original historical-order integrations and include final feature tip e620b60. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
Update grammar for interfaces, add additional prose to describe the rules for static abstract and virtual members in interfaces. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
Preserve source-owned feature intent and approved predecessor precedence. Static-interface fallback phases remain intact; expression E applicability, absent-source-type guards and identity deduplication are not replaced by speculative older feature text. No feature numbering tool invoked. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21570b74-c6f5-4fc5-ab6d-7546918d6ddb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
BillWagner
force-pushed
the
v11-static-abstract-members-in-interfaces
branch
from
November 12, 2026 23:37
e620b60 to
c4cfc9e
Compare
BillWagner
added a commit
that referenced
this pull request
Nov 12, 2026
Preserve current committee source and genuine feature additions; resolve the recorded mechanical source overlap. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 361b9a77-2b4c-45e6-969f-e6785c47f27e
Add additional updates and requirements for static abstract interfaces, as implemented in C# 11.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is Rex's adaptation of the corresponding MS proposal.
Issue
The MS spec contains a section called “Pattern matching.” In there, a change to constant patterns is proposed. However, I cannot find the text below they propose augmenting, anywhere in the spec
Note that the proposed new text refers to
System.Numerics.INumberBase<T>, which I mention elsewhere in the PR as needing attention.