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

[ObjCRuntime] Work around a difference in .NET where Type.IsInterface doesn't work the same way for byref types. #9466

Merged

Conversation

rolfbjarne
Copy link
Member

Ref: dotnet/runtime#39068

Fixes this test:

MonoTouchFixtures.ObjCRuntime.RegistrarTest
    [FAIL] RefOutTest_INSCoding : System.InvalidCastException : Unable to cast object of type 'Foundation.NSString' to type 'Foundation.INSCoding&'.
        at ObjCRuntime.Runtime.GetINativeObject(IntPtr ptr, Boolean owns, Type target_type, Type implementation)
        at ObjCRuntime.Runtime.GetINativeObject(IntPtr ptr, Boolean owns, Type target_type)
        at ObjCRuntime.Runtime.GetINativeObject_Dynamic(IntPtr ptr, Boolean owns, IntPtr type_ptr)
        at ObjCRuntime.Runtime.get_inative_object_dynamic(IntPtr obj, Boolean owns, IntPtr type, Int32& exception_gchandle)
        --- End of stack trace from previous location ---
        at MonoTouchFixtures.ObjCRuntime.RegistrarTest.RefOutTest_INSCoding() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs:line 2908
        at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

… doesn't work the same way for byref types.

Ref: dotnet/runtime#39068

Fixes this test:

    MonoTouchFixtures.ObjCRuntime.RegistrarTest
        [FAIL] RefOutTest_INSCoding : System.InvalidCastException : Unable to cast object of type 'Foundation.NSString' to type 'Foundation.INSCoding&'.
            at ObjCRuntime.Runtime.GetINativeObject(IntPtr ptr, Boolean owns, Type target_type, Type implementation)
            at ObjCRuntime.Runtime.GetINativeObject(IntPtr ptr, Boolean owns, Type target_type)
            at ObjCRuntime.Runtime.GetINativeObject_Dynamic(IntPtr ptr, Boolean owns, IntPtr type_ptr)
            at ObjCRuntime.Runtime.get_inative_object_dynamic(IntPtr obj, Boolean owns, IntPtr type, Int32& exception_gchandle)
            --- End of stack trace from previous location ---
            at MonoTouchFixtures.ObjCRuntime.RegistrarTest.RefOutTest_INSCoding() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs:line 2908
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
@rolfbjarne rolfbjarne added the not-notes-worthy Ignore for release notes label Aug 24, 2020
@rolfbjarne rolfbjarne mentioned this pull request Aug 24, 2020
61 tasks
@monojenkins
Copy link
Collaborator

Build success
Provisioning succeeded
Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
Test run succeeded

@rolfbjarne rolfbjarne merged commit 1ef83b9 into xamarin:main Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-notes-worthy Ignore for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants