-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Type.IsAssignableTo #40326
Type.IsAssignableTo #40326
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
src/libraries/System.Private.CoreLib/src/System/Type.Helpers.cs
Outdated
Show resolved
Hide resolved
I assume static bool Test<T1, T2>() => typeof(T1).IsAssignableTo(typeof(T2)); is optimized to true/false for known types (except Nullable and shared generics) 🙂 |
That would require fixes in the JIT. I do not think the existing JIT optimization will be able to cut through |
Oops. sorry 🙁 |
48de4b4
to
4eb0091
Compare
/cc @steveharter @GrabYourPitchforks as System.Reflection area owners |
I think this should also expand the optimizations done for |
@benaadams feel free to ping if you need any help |
eb15046
to
b4b7b5e
Compare
b4b7b5e
to
4389f2a
Compare
Do we need test for the optimization, similar to |
And also general functional tests for the API |
That's a new error, don't think its from this change though
|
Added test; seems unhappy with unrelated issue
|
runtime (CoreCLR Product Build OSX x64 checked) broke or got chopped
|
OSX Issue is already reported #34472 |
Thanks |
Resolves #30714