You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 24, 2022. It is now read-only.
In .Net, you can create delegate to instance method that will accept object on which you want call it as first delegate call argument. It is not supported in JSIL. Here is small test case:
using System;
using System.Runtime.InteropServices;
public static class Program
{
public static void Main()
{
var d = (Action<ClassWithInstanceMember>)Delegate.CreateDelegate(typeof(Action<ClassWithInstanceMember>), null, typeof(ClassWithInstanceMember).GetMethod("Run"));
d(new ClassWithInstanceMember(1));
d(null);
}
}
public class ClassWithInstanceMember
{
public int _value;
public ClassWithInstanceMember(int value)
{
_value = value;
}
public void Run()
{
if (this != null)
{
Console.WriteLine("this: " + _value);
}
else
{
Console.WriteLine("this==null ");
}
}
}
I will work on this issue, as it is requirement for Expression Interpreter work with instance methods. Full test case should check: