You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 14, 2022. It is now read-only.
The following is a (incomplete) list of collected issues or deficiencies (that is, documented but not very visible) on the current language documentation. Some of them are directly related to the language shortcoming as well. Short answers are provided.
How does WHATEVER differ from any? WHATEVERignores the checking while any will be no way usable in the checking. By using any you force the usage of assume (which is safer than WHATEVER).
How can I specify types for variadic arguments? Using string.format as an example: --v function(fmt: string, ...: any) --> string, or ... --: any on the declaration. Note the symmetry.
Why can't I omit any argument? It will accept an explicit nil value but you need any? to omit any arguments.
How can I use union types? T | U. You will need --# assume to destructure it.
How can I use nilable types? T?. You can explicitly assign it to T, or --# assume to get rid of nil.
How can I use "modules"? Any table can be declared with --: module to enable the delayed type checking against its methods.
Can I use --: module against classes? Yes, e.g. SomeClass = class() --: module.
How can I use [make_class]? Normally via --# assume. You can also use [make_class] with [NO_CHECK] functions. The resulting function should be appropriately typed (currently function() --> any).
How can I represent the lack of return type? --> () or use --v form. (When --v is not in use, the missing return type will be inferred.) If your function never returns, use --> !.
How can I specify types for each fields in the table? Currently you need to use the whole type for the entire table: a = { x = 1, y = 2 } --: { x: integer, y: integer }.
The text was updated successfully, but these errors were encountered:
The following is a (incomplete) list of collected issues or deficiencies (that is, documented but not very visible) on the current language documentation. Some of them are directly related to the language shortcoming as well. Short answers are provided.
WHATEVER
differ fromany
?WHATEVER
ignores the checking whileany
will be no way usable in the checking. By usingany
you force the usage ofassume
(which is safer thanWHATEVER
).string.format
as an example:--v function(fmt: string, ...: any) --> string
, or... --: any
on the declaration. Note the symmetry.any
argument? It will accept an explicitnil
value but you needany?
to omit any arguments.T | U
. You will need--# assume
to destructure it.T?
. You can explicitly assign it toT
, or--# assume
to get rid of nil.--: module
to enable the delayed type checking against its methods.--: module
against classes? Yes, e.g.SomeClass = class() --: module
.[make_class]
? Normally via--# assume
. You can also use[make_class]
with[NO_CHECK]
functions. The resulting function should be appropriately typed (currentlyfunction() --> any
).--> ()
or use--v
form. (When--v
is not in use, the missing return type will be inferred.) If your function never returns, use--> !
.a = { x = 1, y = 2 } --: { x: integer, y: integer }
.The text was updated successfully, but these errors were encountered: