Jonathan Pryor

Results 112 comments of Jonathan Pryor
trafficstars

> but it still doesn't compile due to: > ```cshapr > JavaSet.ToLocalJniHandle (__this.CriticalExtensionOIDs) > ``` This should use `JavaSet.ToLocalJniHandle (__this.CriticalExtensionOIDs)`. See also: https://github.com/xamarin/xamarin-android/blob/a3267e34d35a457f11ec1bb4565c350002f8c332/src/Mono.Android/Android.Runtime/JavaSet.cs#L173-L286

> Is this something we would expect `generator` to figure out? Yes. > and if so, how? Good question. :-) Have a more concrete example in mind? There are only...

Example `generator`-emitted marshal method: ```csharp static void n_Foo(IntPtr jnienv, IntPtr __this, IntPtr __intArray) { var __envp = new JniTransition(__jnienv); try { var __jvm = JniEnvironment.Runtime; var __vm = __jvm.ValueManager; __vm.WaitForGCBridgeProcessing();...

Why does everything keep coming back to making `jnimarshalmethod-gen` *work*? :-/

> Turn [JniNativeMethodRegistration.Marshaler](https://github.com/xamarin/java.interop/blob/1987829f96d58c3298fa1e3d86ef3cd0e12e6c31/src/Java.Interop/Java.Interop/JniNativeMethodRegistration.cs#L14) into a "union", so that it can be either a Delegate or an `IntPtr. > > Can that even be done without breaking ABI? Lol, no. [Marshaling...

[*This*](https://github.com/dotnet/runtime/issues/65853#issuecomment-1050207321) is relatedly good to know: > If you need to get a delegate for an `UnmanagedCallersOnly` method, you can call `Marshal.GetDelegateForFunctionPointer` on the return value from `RuntimeMethodHandle.GetFunctionPointer()`. As mentioned...

The shortened version the Java code that is being compiled is: ```java interface GenericIface { public void m (T value); } interface ExtendedRunnable extends Runnable { } interface SpecificIface extends...

A possible workaround is to bypass this bug in the Java Callable Wrapper generator by binding a new Java class which has the appropriate inheritance hierarchy: ```java package jcw_kludge; public...

Possible Workaround number 2 -- only sketched out here -- doesn't require an intermediate `.jar` file, but does require the same `jcw_kludge.MainAppCompatActivity` Java class. Step 1: Add a `MainAppCompatActivity.java` to...

The bug is here: https://github.com/xamarin/java.interop/blob/56955d9ad3952070de3bb1718375b368437f7427/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGenerator.cs#L547-L550 The problem is that we iterate over all C# interfaces implemented by the type (e.g. `MainActivity`), and this iteration returns *both* `TabLayout.IOnTabSelectedListener2` *and* `TabLayout.IOnTabSelectedListener`, even...