Skip to content

Missing diagnostics for use of variables from parent function bodies #1331

@TwitchBronBron

Description

@TwitchBronBron

BrightScript does not support closures, so we need to properly warn when referencing outer variables from inner functions.

In v1.0.0-alpha.39 there is no diagnostic for referencing outer in this example, but there should be.

Image

function test(outer = 1)
    test2 = function(inner = 2)
        print outer + inner
    end function
end function

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions