Commit 6764bb78 authored by Vinicius Jarina's avatar Vinicius Jarina
Browse files

Only fallback to delegate if is invokable

parent 35dcffb0
...@@ -148,7 +148,7 @@ namespace NLua ...@@ -148,7 +148,7 @@ namespace NLua
if (luatype == LuaType.Function || luatype == LuaType.Nil) if (luatype == LuaType.Function || luatype == LuaType.Nil)
return _extractValues[paramType]; return _extractValues[paramType];
} }
else if (typeof(Delegate).IsAssignableFrom(paramType) && luatype == LuaType.Function) else if (typeof(Delegate).IsAssignableFrom(paramType) && luatype == LuaType.Function && paramType.GetMethod("Invoke") != null)
return new DelegateGenerator(_translator, paramType).ExtractGenerated; return new DelegateGenerator(_translator, paramType).ExtractGenerated;
else if (paramType.IsInterface && luatype == LuaType.Table) else if (paramType.IsInterface && luatype == LuaType.Table)
return new ClassGenerator(_translator, paramType).ExtractGenerated; return new ClassGenerator(_translator, paramType).ExtractGenerated;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment