fixed nullable value type generated the wrong checkValueType method, should use the checkNullable method
@@ -1130,6 +1130,9 @@ namespace SLua
}
else if (IsValueType(t))
{
+ if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>))
+ return string.Format("checkNullable(l,{2}{0},out {1});", n, v, prefix);
+ else
return string.Format("checkValueType(l,{2}{0},out {1});", n, v, prefix);
}
else if (t.IsArray)
@@ -1720,6 +1723,9 @@ namespace SLua
else if (t.BaseType == typeof(System.MulticastDelegate))
Write(file, "int op=LuaDelegation.checkDelegate(l,{2}{0},out {1});", n, v, nprefix);
else if (IsValueType(t))
+ if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>))
+ Write(file, "checkNullable(l,{2}{0},out {1});", n, v, nprefix);
+ else
Write(file, "checkValueType(l,{2}{0},out {1});", n, v, nprefix);
else if (t.IsArray)
Write(file, "checkArray(l,{2}{0},out {1});", n, v, nprefix);
