summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/tests.cratera12
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 = {}