Skip to content

exported variables override local ones #385

@tjahn

Description

@tjahn

Hello,

With the recent update for hoisting supported I experienced this bug:

declare function print(...args:any[]);
export const foo = 5;
function bar( foo:string ) {
  print( foo );
}

this code compiles to


local exports = exports or {};
exports.foo = 5;
local bar;
bar = function(foo)
    print(exports.foo);
end;
return exports;

.



What I expected was “print(foo)” instead.


Kind regards, tjahn

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions