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

Requiring utf8 external library from LuaJIT conflicts with >Lua 5.3 utf8 library #371

Closed
piface314 opened this issue Jan 30, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@piface314
Copy link

piface314 commented Jan 30, 2021

Describe the bug
I'm trying to use a library from LuaRocks to support utf8 strings in LuaJIT, since it does not provide a utf8 library like Lua 5.3 and Lua 5.4 do. To require that library, I must use require 'utf8'. But the fields defined in the library are not recognized, the Lua 5.3 library is recognized instead.

To Reproduce
Steps to reproduce the behavior:

  1. Set the runtime environment to LuaJIT.
  2. Create a file called utf8.lua with this content:
return { match = function() end }
  1. Create another file and type:
local utf8 = require 'utf8'
utf8.match()
  1. See that match will show a warning of undefined field.

Expected behavior
It is expected that if the runtime environment is set to a Lua version that does not have the utf8 library, it shouldn't be recognized, allowing an external library with the same name to be required.

Screenshots
image

Environment (please complete the following information):

  • OS: Ubuntu 20.04
  • Is WSL remote? No
  • Client: VSCode
@sumneko sumneko added the bug Something isn't working label Feb 1, 2021
@sumneko sumneko closed this as completed in 5f7221b Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants