Skip to content
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

fix: remove Lua.equal with compile error for lua 5.2, 5.3, 5.4 #118

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

robbielyman
Copy link
Collaborator

lua_equal is deprecated in Lua versions 5.2 and later; the same behavior can be achieved with lua_compare with the equality flag. this commit makes using lua_equal a compile error when lang is 5.2, 5.3 or 5.4. in fact, it is already a compile error (since the C header does not expose the function), but making it fail faster with a helpful replacement suggestion seems useful.

I chose to leave the declaration of equal untouched: I think this is helpful for ZLS, which I find has a tough time resolving switch (lang) in my seamstress project, but I'm happy to take a different route too.

`lua_equal` is deprecated in Lua versions 5.2 and later; the same
behavior can be achieved with `lua_compare` with the equality
flag. this commit makes using `lua_equal` a compile error when `lang`
is 5.2, 5.3 or 5.4. in fact, it is already a compile error (since the
C header does not expose the function), but making it fail faster with
a helpful replacement suggestion seems useful.
src/lib.zig Outdated Show resolved Hide resolved
@natecraddock
Copy link
Owner

Thanks! Just noticed a tiny duplication in the comments. Sorry for the delay

@robbielyman robbielyman merged commit be1990d into natecraddock:main Nov 9, 2024
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