We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
self
Visual Studio Code Extension (sumneko.lua)
Windows
Type Checking
test.lua - No error.
test.lua
---@class Position ---@field x number ---@field y number ---@field z number Position = {} ---@class Creature ---@field teleportTo fun(self:Creature, position:Position):nil Creature = {} ---@class Zone ---@field getName fun(self:Zone):string ---@overload fun(): Zone Zone = {} ---@class Event ---@field onCreatureEnter fun(self:Zone, creature:Creature):nil ---@field onCreatureLeave fun(self:Zone, creature:Creature):nil ---@field register fun(self:Event):nil ---@overload fun(): Event Event = {} local zone = Zone() local zoneEvent = Event() function zoneEvent:onCreatureEnter(creature) if self:getName() == zone:getName() then creature:teleportTo(Position(0, 0, 0)) end end zoneEvent:register()
test.lua - Found error.
Just copy the code and test it in any Lua file. self should be of type Zone, as that's how it's defined in the meta file.
Zone
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Type Checking
Expected Behaviour
test.lua
- No error.Actual Behaviour
test.lua
- Found error.Images example
Reproduction steps
Just copy the code and test it in any Lua file.
self
should be of typeZone
, as that's how it's defined in the meta file.Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered: