diff options
Diffstat (limited to 'test/tests.cratera')
-rw-r--r-- | test/tests.cratera | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/tests.cratera b/test/tests.cratera index fd97917..8977b74 100644 --- a/test/tests.cratera +++ b/test/tests.cratera @@ -9,6 +9,7 @@ t[T] = t t.f = print t.ff = print t.g = function(self, a) print(self, a[1]) end +t.h = function(self, v) return v end t[F] = print local _f="f" local _t="t" @@ -48,6 +49,17 @@ _=(t:[_t].f(11)) -- inside () t:[_t].g {12} -- table call t:[_t].f "13" -- string call +;(function()return t end)():[(function() return t:[(function()return"t"end)()].h("t") end)()].f(14) -- function using traits in trait key +;(function()return t end)():[(function() return (function()return t end)():[(function()return"t"end)()].h("t") end)()].f(15) -- function using traits in trait key +local function call_f(v) + (function()return t end)():["t"].f(v) +end +call_f(16) +call_f = function(v) + (function()return t end)():["t"].f(v) +end +call_f(17) +;t.t.t.t.h(t, t):["t"].f(18) entity = {} |