about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--type.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/type.lua b/type.lua index cf24d0c..6dbf313 100644 --- a/type.lua +++ b/type.lua
@@ -266,7 +266,9 @@ end
266 266
267-- type assertion 267-- type assertion
268function m.assert_type (x, t) 268function m.assert_type (x, t)
269 if not m.isp(x, t) then 269 local pred = function (a) return m.isp(a, t) end
270 if t == "list" then pred = m.listp end
271 if not pred(x) then
270 error("wrong type", m.lamtype(x), t) 272 error("wrong type", m.lamtype(x), t)
271 end 273 end
272end 274end