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

Fix open generic type deductions #4307

Merged
merged 2 commits into from Apr 2, 2023

Conversation

ghost
Copy link

@ghost ghost commented Mar 1, 2023

Closes #4243

When I investigated why it was resolving to double, double, I found that it would try to get the best common type twice for each type args because of this IsGenericParameter condition rather than match them via their underlying type. I found it odd: why would it try to check matches between the first arg with the second type param and the second arg with the first one?

I ran some git blame and I found that this if was added as a result of #358 and while I am not too familiar with the project's history, I did some research and it seems NETCF support was removed in this repository a long time ago. It seems to me that it was added due to generics being weirder to support on that platform, but since it isn't supported anymore, it seems that it should be removed if it causes problems which I think it does here.

@rprouse
Copy link
Member

rprouse commented Mar 6, 2023

This looks good but can you add some unit tests?

@ghost
Copy link
Author

ghost commented Mar 6, 2023

Done, I found a way to ensure the existing test cover this case.

Copy link
Member

@OsirisTerje OsirisTerje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now.

@OsirisTerje OsirisTerje merged commit 2f685cd into nunit:master Apr 2, 2023
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.

Type args are not deduced correctly for parameterized fixtures
3 participants