Skip to content

⚠️ Incorrect function compiling #382

Description

@Keller18306

Describe the bug

Incorrect compiling the function with return LuaMultiReturn. Code breaks.

To Reproduce

mtasa.addCommandHandler('anime', () => {
    mtasa.outputChatBox('Nya!')
    const [width, height] = mtasa.guiGetScreenSize()
//code breaks executing
    mtasa.outputChatBox(`${width} - ${height}`)
})

Expected behavior

The code doesn't crash. And at compile time, unpack is not added

Screenshots

image

Desktop information

win11

NPM Version

{
  npm: '8.12.1',
  node: '16.15.1',
  v8: '9.4.146.24-node.21',
  uv: '1.43.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '93',
  nghttp2: '1.47.0',
  napi: '8',
  llhttp: '6.0.4',
  openssl: '1.1.1o+quic',
  cldr: '40.0',
  icu: '70.1',
  tz: '2021a3',
  unicode: '14.0',
  ngtcp2: '0.1.0-DEV',
  nghttp3: '0.1.0-DEV'
}

NPM Package versions

test@ C:\MTA Server\server\mods\deathmatch\resources\[ZombiePlague]
├── @typescript-eslint/eslint-plugin@4.33.0
├── @typescript-eslint/parser@4.33.0
├── @typescript-to-lua/language-extensions@1.0.0
├── eslint@7.32.0
├── mtasa-lua-types@1.1.0
├── mtasa-lua-utils@1.0.4
├── prettier@2.7.1
├── typescript-to-lua@1.3.4
└── typescript@4.5.5

Additional context

Without unpack code continue executing without problems

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions