-
-
Notifications
You must be signed in to change notification settings - Fork 184
Closed
Labels
Description
I reproduce this bug using string.find, but maybe it applies to all @tupleReturn?
The following code reproduces this error on the tstl playground:
// works as it should
const result = string.find("a", "b");
const [c, ...d] = result;
// Doesn't work
const [a, ...b] = string.find("a", "b");
Gets translated to
result = {
string.find("a", "b")
}
c = result[1]
d = __TS__ArraySlice(result, 1)
local ____ = string.find("a", "b")
a = ____[1]
b = __TS__ArraySlice(____, 1)
On the second case, it uses string.find result directly without putting it into a table, which causes a nil error.
Reactions are currently unavailable