-
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
Fix calling existing ctor with MethodInvoker; share tests with invokers #90796
Conversation
Tagging subscribers to this area: @dotnet/area-system-reflection Issue Details[verifying tests]
|
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (Please check that the affected tests are passing in the extra-platforms legs before merging.)
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvokerCommon.cs
Outdated
Show resolved
Hide resolved
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
CI failures in runtime-extra-platforms appear consistent with other recent PRs including #90836 and #90864. Created some known issues to help filter the errors in the future. Also, there's some infra work needed so failures running runtime-extra-platforms show all of the unknown failures (currently just the first 4 are shown). |
/backport to release/8.0 |
1 similar comment
/backport to release/8.0 |
Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/5945904726 |
Refactored the existing
MethodInfo\ConstructorInfo
tests so they can also run under the new invoker classesMethodInvoker\ConstructorInvoker
; they are run in both a forced-interpreted and a forced-emit mode for additional coverage.This uncovered two edge case issues (fixed in this PR) that only affect the new invoker classes that were added in Preview 7:
MethodInvoker
now works as expected: theobj
parameter's constructor is invoked andnull
is returned; this is consistent withConstructorInfo.Invoke(obj, ...)
MemberAccessException
(same exception type used for similar cases). Calling static constructors can still be done withConstructorInfo
but since that is rare, adds overhead, and is not supported on NativeAOT, support wasn't added toMethodInvoker
orConstructorInvoker
.No tests were removed except for the invoker test "ExistingInstance()" which was already covered in the shared tests.
These changes should be ported to v8\RC2 since they only affect the new APIs added in Preview 7 and will avoid a breaking change in v9.