TypeScriptToLua icon indicating copy to clipboard operation
TypeScriptToLua copied to clipboard

Functions with tuple return types shouldn't be compatible with regular tuples

Open ark120202 opened this issue 7 years ago • 0 comments

interface A {
    /** @tupleReturn */
    foo(): number[];
}

class B {
    foo() {
        return [1, 2];
    }
}

const a: A = new B();
// type of `result` is `number`, but value is `{ 1, 2 }`
const [result] = a.foo();

ark120202 avatar May 15 '19 11:05 ark120202