Yonaba / Lua-Class-System

Lua Class System (LCS) is a small library which offers a clean, minimalistic but powerful API for (Pseudo) Object Oriented programming style using Lua.
http://yonaba.github.com/Lua-Class-System
64 stars 17 forks source link

error on collect garbage #14

Open FedorZaytsev opened 9 years ago

FedorZaytsev commented 9 years ago

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

abigpotostew commented 9 years ago

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)