Closed
Description
using TSTL 1.29.1, targeting JIT
I have typescript code performing bitwise operations, with a parameter named bit
:
function shiftIt(bit: number): number {
return bit << 1;
}
it will compile fine but produce the following (with a JIT target):
local function shiftIt(self, bit)
return bit.lshift(bit, 1)
end
Here the bit
parameter name overwrites the bitOp
module name, and produces a runtime error. I can fix it by renaming the parameter to b
or something else, but it seems like this requires an unnecessary amount of knowledge about the generated code. Would it be possible to remap parameters that conflict with imports somehow?
(By the way, this doesn't show up on the playground, because it seems like that has a 5.4 target, which uses <<
, etc)
Metadata
Metadata
Assignees
Labels
No labels