Skip to content

argument defaults #110

@tmbdev

Description

@tmbdev

I would find it useful if typedlua allowed defaults for arguments; this often is useful for being able to specify a more restrictive type, e.g. "string" instead of "string?"

function f(x:string="something"): string
    return x..x
end

instead of

function f(x: string?): string
    if x==nil then x = "something" end
    return x..x
end

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