Skip to content

Fixed @tupleReturn on interface function properties#582

Merged
Perryvw merged 3 commits intomasterfrom
tuplereturn-interfaces-fix
May 18, 2019
Merged

Fixed @tupleReturn on interface function properties#582
Perryvw merged 3 commits intomasterfrom
tuplereturn-interfaces-fix

Conversation

@tomblind
Copy link
Copy Markdown
Collaborator

@tomblind tomblind commented May 15, 2019

fixes #578

Also fixed detection of @tupleReturn on object literal methods/function-properties that are assigned to interaces:

interface Foo {
    /** @tupleReturn **/
    method(): [number, number];

    /** @tupleReturn **/
    funcProp: () => [number, number];
}
const foo: Foo = {
    method() { return [3, 4]; }, // Should not wrap return value
    funcProp: () => [3, 4], // Also should not wrap return value
};

Also fixed detection of @tupleReturn on object literal methods/function-properties that are assigned to interaces.
@Perryvw Perryvw merged commit 63f5568 into master May 18, 2019
@Perryvw Perryvw deleted the tuplereturn-interfaces-fix branch May 18, 2019 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TupleReturn only works on method definitions, not on function-typed variables.

2 participants