-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spec forbidding constant numeric patterns on INumberBase<T>
#6273
Conversation
We want to block this for C# 11, so that a future version of C# can call the appropriate APIs on `INumberBase` and make this scenario work as expected.
@dotnet/roslyn-compiler @tannergooding for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM and matches how the interfaces are currently modeled. All numbers and number related interfaces derive from INumberBase<TSelf>
the ones that don't are the basic operator interfaces that are the building blocks behind INumberBase<TSelf>
.
…om or constrained to INumberBase<T> To ensure we have a good user experience and avoid any potential breaking changes later, we block this scenario for types that don't have known conversions from patterns. Spec change: dotnet/csharplang#6273.
@jcouv please take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks (iteration 2)
…om or constrained to INumberBase<T> (#62653) To ensure we have a good user experience and avoid any potential breaking changes later, we block this scenario for types that don't have known conversions from patterns. Spec change: dotnet/csharplang#6273.
We want to block this for C# 11, so that a future version of C# can call the appropriate APIs on
INumberBase
and make this scenario work as expected.