From 249b711f9f23b1a514e8638d4ad0a7f303f44f30 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Wed, 28 Jan 2009 19:38:36 +0000 Subject: [PATCH] Add type checks for function calls --- src/test/errors/operators.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/errors/operators.lua b/src/test/errors/operators.lua index 0dc481fa..a67dc0ca 100644 --- a/src/test/errors/operators.lua +++ b/src/test/errors/operators.lua @@ -23,6 +23,12 @@ notop = function(a) return not a end checkallpass('notop',{somenumber}) checkallerrors('notop',{notanumber},'attempt to perform arithmetic on') +-- function call +banner( '()' ) +funcop = function(a) return a() end +checkallpass('funcop',{somefunction}) +checkallerrors('funcop',{notafunction},'attempt to call') + -- ========= binary ops: .. + - * / % ^ == ~= <= >= < > [] . and or banner( '..' ) concatop = function(a,b) return a..b end @@ -140,7 +146,6 @@ banner( 'or' ) orop = function(a,b) return clean(a or b) end checkallpass('orop',{anylua,anylua}) - -- ========= for x in y banner( 'for x=a,b,c' ) forop = function(a,b,c) for x=a,b,c do end end