I've been trying to use my Android Library (written in Kotlin) in a Xamarin project but I'm stuck in passing Lambda functions to C# generated code of Kotlin
I'm trying to do something like this
client.DoSomething((response) => {}, (error) => {});
But I'm getting this error
CS1660: Cannot convert lambda expression to type 'IFunction1' because it is not a delegate type
This is the generated C# code for my library for this specific function
using Android.Runtime;
using Java.Interop;
using Java.Lang;
using Kotlin.Jvm.Functions;
using System;
[Register ("doSomething", "(Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V", "")]
public unsafe void DoSomething (IFunction1 onSuccess, IFunction1 onFailure);
What's the correct way of doing this?