Skip to content

Where is the type declaration system defined in Luau Source Code? #1190

Discussion options

You must be logged in to vote

This is a relatively involved question. You would have to make a change to the parser code to parse your new type annotation, which needs some degree of care to ensure that the syntax you add is unambiguous. That just adds the syntax support; it won't actually do anything (and will actually crash the type solver) without further effort.

The type solver requires making a number of changes. The old solver will need changes to TypeInfer.cpp. The new solver could require a number of changes across several files depending on what this syntax is designed to do.

Testing those changes is done in files in the tests/ directory.

To address the idea in your original post, you should not add a type an…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@karl-police
Comment options

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