winterwolf

Results 12 comments of winterwolf

`return self` after call solved the issue.

... No, wait. In this case CreatureCL called **twice** 🤦‍♂️

We can add `return setmetatable({}, self)` into `Object:new()` and call it manually to create instances. This solution seems would work well BUT it will not solve the same problem #13...

@rxi Thank you so much sir!

@rxi I'm sorry, but this solution doesn't work well: ```lua local MiddleClass = require "middleclass" local M1 = MiddleClass("M1") function M1:initialize() self.pos = {2, 4} self.size = {6, 8} end...

@taxilly you will be able to see metatables if after this line: https://github.com/rxi/lovebird/blob/e84abe7b56a65ccb3ec6288e1955b6d772d41431/lovebird.lua#L405 add this: ```lua local mt = getmetatable(t) if mt then for k, v in pairs(mt) do t[""]...

This is correct behavior because you define your function in global scope. Add `local` keyword before the function declaration: ```lua local function test() print("test") end ``` Require is doesn't matter...

![screenshot-001](https://user-images.githubusercontent.com/42620439/74686731-129a2100-51db-11ea-99c2-325ff2f3398f.png) I think, `any|nil` in your example is incorrect, because `nil` **is** `any`. Everything is `any`. 🙃

Just don't add them to workspace! Create your project in empty directory and then add only directories with your sources: ![screenshot-001](https://user-images.githubusercontent.com/42620439/74689243-1fbb0e00-51e3-11ea-81bc-c8ef191581d0.png)

Very interesting. Test4 was defined as local, then it temporary becomes global, because you define a new global function with the same name and it overwrite local variable, so at...