Skip to content

Deprecated @tupleReturn and various lualib improvements#1075

Merged
Perryvw merged 7 commits into
masterfrom
bugfix/lualib-getter-dependency
Aug 8, 2021
Merged

Deprecated @tupleReturn and various lualib improvements#1075
Perryvw merged 7 commits into
masterfrom
bugfix/lualib-getter-dependency

Conversation

@Perryvw

@Perryvw Perryvw commented Aug 8, 2021

Copy link
Copy Markdown
Member

This PR replaces any tupleReturn checks with LuaMultiReturn checks, and LuaMultiReturn checks fall back on tupleReturn until support for this annotation is removed. It adds a warning that @tupleReturn is about to be removed.

Also adds a test that checks if lualib functions have the correct dependencies set, to avoid lualib inlining bugs. Also cleaned up tests a bit.

Also optimizes some weird lua I noticed in our lualib:

  • [a, b] = [c, d] now translates to a, b = c, d instead of a, b = __TS__Unpack({ c, d})
  • str1 += v.toString() now translates to str1 .. tostring(v) instead of tostring(str1) .. tostring(tostring(v))

@Perryvw Perryvw changed the title Deprecated @tupleReturn Deprecated @tupleReturn and various lualib improvements Aug 8, 2021
@Perryvw Perryvw merged commit e401bff into master Aug 8, 2021
@Perryvw Perryvw deleted the bugfix/lualib-getter-dependency branch August 8, 2021 19:51
sanikoyes pushed a commit to sanikoyes/TypeScriptToLua that referenced this pull request Sep 24, 2021
…Lua#1075)

* Add test for lualib dependencies and refactor tupleReturn/multiReturn

* Deprecated @tupleReturn

* No longer add not needed tostring calls to string += statements

* upgrade lua-types version to one without @tupleReturn

* Fix linter and make execution not fail when there are only warning diagnostics

* Fix benchmark code for new lua-types

* Disable benchmark workflow
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.

1 participant