-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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.IsInterface returns different values between .NET and Mono for byref types #39068
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
…n't work the same for byref types. Ref: dotnet/runtime#39068
… doesn't work the same for byref types. Ref: dotnet/runtime#39068
… doesn't work the same for byref types. Ref: dotnet/runtime#39068
… doesn't work the same for byref types. Ref: dotnet/runtime#39068
… doesn't work the same for byref types. Ref: dotnet/runtime#39068
… 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)
… doesn't work the same way for byref types. (#9466) 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)
@lambdageek could you investigate what broke? |
There's no bug in the netcore version of Mono. Its output matches CoreCLR (and also .NET Framework, FWIW). The outlier is Mono 6.* from https://github.com/mono/mono which prints If we want to fix this in mono/mono, I'll move the bug there. |
The issue btw, is this code. Non-netcore Mono would need to do the runtime/src/mono/mono/metadata/icall.c Lines 2178 to 2189 in ce51448
|
Closing as by-design |
Description
Test case:
shows True with Mono and False with .NET (on macOS using .NET Core using MonoVM).
Complete test case: consoleapp-fbd84e3.zip
Download, unzip, and run
make both
:Configuration
macOS 10.15
The text was updated successfully, but these errors were encountered: