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

Suggest type parameter constraints, including "generic math" interfaces #60878

Open
alrz opened this issue Apr 21, 2022 · 0 comments
Open

Suggest type parameter constraints, including "generic math" interfaces #60878

alrz opened this issue Apr 21, 2022 · 0 comments
Labels
Area-IDE Feature Request Need Design Review The end user experience design needs to be reviewed and approved.
Milestone

Comments

@alrz
Copy link
Contributor

alrz commented Apr 21, 2022

Opened dotnet/runtime#59030 a while back because I find it hard to discover all the generic math interfaces due to naming. I definitely missed a bunch, see IFloatingPointIeee754.

I think roslyn can help with suggesting the correct constraints.

bool M<T>(T a, T b) => a > b;

->

bool M<T>(T a, T b) where T : IComparisonOperators<..> => a > b;

If there's multiple possible choices, it could list all of them for discoverability.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Language Design untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 21, 2022
@jcouv jcouv added the Area-IDE label Apr 21, 2022
@jinujoseph jinujoseph added Feature Request Need Design Review The end user experience design needs to be reviewed and approved. and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 28, 2022
@jinujoseph jinujoseph added this to In Queue in IDE: Design review via automation Apr 28, 2022
@jinujoseph jinujoseph added this to the Backlog milestone Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request Need Design Review The end user experience design needs to be reviewed and approved.
Projects
Status: In Queue
IDE: Design review
  
In Queue
Development

No branches or pull requests

3 participants