Skip to content

Syntax for pragmas #751

Answered by hishamhm
hishamhm asked this question in Q&A
Jun 13, 2024 · 6 comments · 8 replies
Discussion options

You must be logged in to vote

It would make more sense to load the old module with compat options

I have just updated the pragmas PR so that the following works:

--#pragma arity off
local old_module = require("old_module")
--#pragma arity on

...and the arity-off rules apply to functions exported by old_module even when called from within arity-on parts of the code (because the old_module does not have ? annotations). See the test cases for full examples.

This should make it easier for people to switch to new arity rules gradually!

Replies: 6 comments 8 replies

Comment options

You must be logged in to vote
3 replies
@Andre-LA
Comment options

@catwell
Comment options

@hishamhm
Comment options

hishamhm Jun 14, 2024
Maintainer Author

Comment options

You must be logged in to vote
0 replies
Comment options

hishamhm
Jun 13, 2024
Maintainer Author

You must be logged in to vote
4 replies
@euclidianAce
Comment options

@hishamhm
Comment options

hishamhm Jun 14, 2024
Maintainer Author

@catwell
Comment options

@hishamhm
Comment options

hishamhm Jun 14, 2024
Maintainer Author

Comment options

hishamhm
Jun 14, 2024
Maintainer Author

You must be logged in to vote
0 replies
Comment options

hishamhm
Jun 16, 2024
Maintainer Author

You must be logged in to vote
1 reply
@hishamhm
Comment options

hishamhm Jun 16, 2024
Maintainer Author

Answer selected by hishamhm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants