Lua-Class-System icon indicating copy to clipboard operation
Lua-Class-System copied to clipboard

error on collect garbage

Open FedorZaytsev opened this issue 9 years ago • 1 comments

This code from your examples gives me an error after calling collectgarbage('collect')

LCS = require('LCS') Animal = LCS.class()

function Animal:yell() print('Yelling!') end

Dog = Animal:extends {name = nil} function Dog:init(name) self.name = name end

function Dog:yell() self:super('yell') end

puppet = Dog('waffles') print(puppet.name) --> waffles collectgarbage('collect') puppet:yell() --> Yelling!

Error: lua5.1: ./LCS.lua:156: attempt to index field '?' (a nil value) stack traceback: ./LCS.lua:156: in function 'super' test.lua:13: in function 'yell' test.lua:19: in main chunk [C]: ?

FedorZaytsev avatar Mar 15 '15 08:03 FedorZaytsev

If you run tests.lua, this failure is reported in test 4. Also seems test 6 is failing:

2 tests aborted.. Test 4 : ./LCS.lua:132: attempt to index field '?' (a nil value) Test 6 : [string " local LCS = require 'LCS'..."]:3: attempt to call field 'static' (a nil value)

abigpotostew avatar Jun 22 '15 23:06 abigpotostew