Skip to content

Fix noSelf in object literal methods#1088

Merged
Perryvw merged 3 commits intoTypeScriptToLua:masterfrom
GlassBricks:object-literal-method-noSelf
Aug 15, 2021
Merged

Fix noSelf in object literal methods#1088
Perryvw merged 3 commits intoTypeScriptToLua:masterfrom
GlassBricks:object-literal-method-noSelf

Conversation

@GlassBricks
Copy link
Contributor

Fixes #1081.

Found the internal method on ts.TypeChecker that does what is needed.

return [foo.method("a") ?? "nil", foo.func("b") ?? "nil", foo.arrow("c") ?? "nil"]
`.expectToMatchJsResult();
// language=TypeScript
util.testFunction`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this into two separate tests

}
);

test("noSelf in object literal functions", () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Perryvw Perryvw merged commit a738dfc into TypeScriptToLua:master Aug 15, 2021
@GlassBricks GlassBricks deleted the object-literal-method-noSelf branch September 5, 2021 20:29
sanikoyes pushed a commit to sanikoyes/TypeScriptToLua that referenced this pull request Sep 24, 2021
* Fix noSelf in object literal methods

* Add isObjectLiteralExpression check on parent

This check is absent in the internal typescript method

* Add more tests for PR

Co-authored-by: Benjamin Ye <24237065+enjoydambience@users.noreply.github.com>
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.

Method declarations object literals don't remove self parameter

2 participants