Skip to content

Referencing return value in callback passed as argument #894

@tomblind

Description

@tomblind

playground

This is a similar situation to recursive functions. The correct lua should declare the variable separately from assigning it in these circumstances.

local h
h = ____exports.subscribe(
    function()
        print(h.foobar)
    end
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions