Closed sircfenner closed 10 months ago
Adding a type assertion to a function call has the (runtime) effect of truncating any returned values to a maximum of one value:
local function multipleReturns() return 1, 2 end print(multipleReturns() :: any)
This will output "1".
Currently, the 'remove_types' rule translates line 4 as:
print(multipleReturns())
This will output both "1" and "2", incorrectly.
The 'remove_types' rule should wrap these type-asserted calls in parentheses:
print((multipleReturns()))
This will output "1", correctly.
Good catch! This should be a simple fix, I already have this kind of verification in other parts of darklua
Adding a type assertion to a function call has the (runtime) effect of truncating any returned values to a maximum of one value:
This will output "1".
Currently, the 'remove_types' rule translates line 4 as:
This will output both "1" and "2", incorrectly.
The 'remove_types' rule should wrap these type-asserted calls in parentheses:
This will output "1", correctly.