Skip to content

Add compileError when a function is used where it is not supported #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

sea-grass
Copy link
Contributor

This PR adds a @compileError statement with a helpful error message if the user tries to reference a function that is unavailable in their chosen lang.

Most of these functions previously only had a doc comment clarifying e.g. that they're only supported in Luau, so in most cases this adds additional safety. However, there was one function, raiseInterruptErrorStr, which became a no-op if the lang weren't Lua, instead of providing an error. While I took the approach of raising a compile error if the function were used but not supported, there is precedent of turning an unsupported function into a no-op. While I believe the more appropriate path would be to raise a compile error, I'm interested in hearing what the preferred outcome is for these cases.

@robbielyman robbielyman merged commit ac76219 into natecraddock:main Apr 23, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants