Skip to content

.NET 9 support #93

Description

Hello, I was experimenting with your library and noticed yielding does not seem to work on .NET 9, it seems to work on .NET 8 though. Are there any plans for supporting .NET 9? On .NET 9 its throwing runtime exceptions so I assume its something microsoft changed with delegates.

The code I used for my test is

static void Main(string[] args)
{
    var l = new Lua();
    l.Register("yieldTest", TestFunc);
    var c = l.NewThread();

    if(c.LoadString("print('hello world!!');yieldTest();print('after yield!!');") != LuaStatus.OK)
        Console.WriteLine(c.ToString(-1));
    else Console.WriteLine("successfully loadedstring");

    Console.WriteLine(c.Resume(c, 0));
    Console.ReadKey();
    c.Resume(c, 0);
}

static int TestFunc(IntPtr ptr)
{
    var L = Lua.FromIntPtr(ptr);
    Console.WriteLine("emitting a yield");
    return L.Yield(0);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions