Mercurial Hosting > luan
changeset 1356:71f067287642
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 18 Apr 2019 00:34:04 -0600 |
parents | b84f60ebe196 |
children | 70a7eb76ee2c |
files | src/luan/LuanJavaFunction.java |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/luan/LuanJavaFunction.java Wed Apr 17 01:32:52 2019 -0600 +++ b/src/luan/LuanJavaFunction.java Thu Apr 18 00:34:04 2019 -0600 @@ -124,7 +124,14 @@ if( paramType.isPrimitive() ) throw new LuanException("bad argument #"+(i+1-start)+" ("+expected+" expected, got nil)"); } else { - String got = fixType(arg.getClass().getSimpleName()); + String got; + if( arg instanceof LuanFunction ) { + got = "function"; + } else { + got = fixType(arg.getClass().getSimpleName()); + if( got.equals("") ) + got = arg.getClass().toString(); + } throw new LuanException("bad argument #"+(i+1-start)+" ("+expected+" expected, got "+got+")"); } } @@ -142,7 +149,7 @@ return "boolean"; if( type.equals("String") ) return "string"; - if( type.equals("Closure") ) + if( type.equals("LuanClosure") ) return "function"; if( type.equals("LuanJavaFunction") ) return "function";