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

Generic Methods: better generic method support. #1106

Merged
merged 2 commits into from Mar 22, 2022
Merged

Generic Methods: better generic method support. #1106

merged 2 commits into from Mar 22, 2022

Conversation

ghost
Copy link

@ghost ghost commented Mar 12, 2022

covariance + contravariance - where generic arguments are derived from base generic argument type

Tim Cassidy added 2 commits March 11, 2022 18:09
…riance - where generic arguments are derived from base generic argument type
…rwise generic extension methods that aren't covariant/contravariant won't work with alternate types
@ghost
Copy link
Author

ghost commented Mar 21, 2022

no rush - but just bumping this PR @lahma + @sebastienros in case you didn't see it.

added new tests to show how the existing support for generic extensions is broken. So if you just grab my tests and put them into mainline - you can see how they fail.

I have another PR incoming to notify programmers with a "thread safety" exception when they try to use JINT across multiple threads. It's a small update - but I think the wording of the exception and probably the type of exception will require your input.

@ghost ghost mentioned this pull request Mar 21, 2022
Copy link
Collaborator

@lahma lahma left a comment

Choose a reason for hiding this comment

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

Just an observation about whether struct would be more memory efficient. Looks solid and test coverage gives confidence.

@@ -1124,6 +1124,19 @@ private static int CalculateMethodScore(Engine engine, MethodDescriptor method,
return score;
}

internal class AssignableResult
Copy link
Collaborator

Choose a reason for hiding this comment

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

readonly struct?

@lahma lahma merged commit 0e315f4 into sebastienros:main Mar 22, 2022
@ghost ghost deleted the issues/tpc/betterGenericMethodHandling branch March 22, 2022 18:31
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

1 participant