Skip to content

Type definition files, questions & feedback #683

Discussion options

You must be logged in to vote

(I'll prefix this by saying these are just my own observations, and they might be wrong)

  1. How do I declare var-args of some specific type at the end of function argument list?

Its similar to how it works in general Luau syntax: https://luau-lang.org/typecheck#variadic-types
In function declaration syntax, it should be

declare function foo(...: number): ()

whilst in function type syntax, it'll be

type Foo = (...number) -> ()
  1. There seems to be some other cases where loading a broken type definition does not produce an error message.

Note that the error message is not stored directly in the LoadDefinitionResult.
For parse errors, they will be in result.parseResult.errors
For type er…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@petrihakkinen
Comment options

@alexmccord
Comment options

Answer selected by petrihakkinen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants