changeset 860:626815a4b19b

minor fix
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 27 Sep 2016 22:20:07 -0600
parents 3dcc52e17535
children cdab48877cfe
files src/luan/LuanJavaFunction.java
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
diff -r 3dcc52e17535 -r 626815a4b19b src/luan/LuanJavaFunction.java
--- a/src/luan/LuanJavaFunction.java	Wed Sep 21 16:15:19 2016 -0600
+++ b/src/luan/LuanJavaFunction.java	Tue Sep 27 22:20:07 2016 -0600
@@ -11,6 +11,7 @@
 import java.util.Set;
 import java.util.Arrays;
 import java.util.Collection;
+import luan.impl.Closure;
 
 
 public final class LuanJavaFunction extends LuanFunction {
@@ -117,7 +118,7 @@
 					if( paramType.isPrimitive() )
 						throw new LuanException("bad argument #"+(i+1-start)+" ("+expected+" expected, got nil)");
 				} else {
-					String got = fixType(arg.getClass().getSimpleName());
+					String got = arg instanceof Closure ? "function" : fixType(arg.getClass().getSimpleName());
 					throw new LuanException("bad argument #"+(i+1-start)+" ("+expected+" expected, got "+got+")");
 				}
 			}
@@ -135,8 +136,6 @@
 			return "boolean";
 		if( type.equals("String") )
 			return "string";
-		if( type.equals("Closure") )
-			return "function";
 		if( type.equals("LuanJavaFunction") )
 			return "function";
 		return type;