Skip to content

Does Lua-CSharp support nullable values? #51

@Dismalitie

Description

@Dismalitie

Hey, I was wondering if this supports nullable values in functions (string?, int? etc...) because when calling an empty function from Lua:

w.create()

it throws:

bad argument #1 to 'create' (value expected)

This is the C# function:

[LuaMember("create")]
public static void Create(string? title, int? width = 700, int? height = 400)
{
    f = new Form()
    {
        Text = title == null ? "gluaWindow" : title,
        Width = width == null ? 700 : (int)width,
        Height = height == null ? 400 : (int)height,
    };
}

I don't know if this has to do with issue #50 or whether Lua and / or this library doesn't support nullables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions