Skip to content
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

Merged
merged 2 commits into from
Jul 18, 2022

Conversation

333fred
Copy link
Member

@333fred 333fred commented Jul 13, 2022

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.

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.
@333fred 333fred requested a review from a team as a code owner July 13, 2022 16:11
@333fred
Copy link
Member Author

333fred commented Jul 13, 2022

@dotnet/roslyn-compiler @tannergooding for review.

Copy link
Member

@tannergooding tannergooding left a 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>.

333fred added a commit to 333fred/roslyn that referenced this pull request Jul 14, 2022
…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.
@333fred
Copy link
Member Author

333fred commented Jul 14, 2022

@jcouv please take another look.

Copy link
Member

@jcouv jcouv left a 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)

@333fred 333fred merged commit e6d8c4b into dotnet:main Jul 18, 2022
@333fred 333fred deleted the forbid-inumber branch July 18, 2022 20:20
333fred added a commit to dotnet/roslyn that referenced this pull request Jul 25, 2022
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants