Skip to content

Don't warn about unused globals when both defined implicitly and through std #196

@NutchapolSal

Description

@NutchapolSal

here's an example:

a game has the function foo it calls, but it lets the lua file define it

function foo()
	local x = math.random(1, 999)
	draw.bars_on_screen(x)

	x = math.some_stuff(10, x)
	draw.some_more_baz(x)
end

i have allow_defined enabled, and draw and it's fields defined in std

foo() doesn't come up in the rest of the lua file, so it now warns that foo() is an unused global

i'm suggesting that when this new option is enabled then if it is both defined in std and implicitly inside the file, then don't warn about it.

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