rzel / kahlua

Automatically exported from code.google.com/p/kahlua
0 stars 0 forks source link

@LuaMethod with overloading #19

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently @LuaMethod does not support overloading.
I want this to work:

@LuaMethod
public void foo(String s);

@LuaMethod
public void foo(int i);

Kahlua should choose the correct one to call based on the input parameters.
This can be done by detecting if overloading is necessary (i.e. atleast two
methods wants to bind to the same name) and if so, create a proxy method
that calls the real methods by iterating over them and picking the first
one that matches with all arguments.

Methods with more parameters should probably be prioritized in that list
over methods with fewer parameters.

Original issue reported on code.google.com by kristofer.karlsson@gmail.com on 17 Nov 2009 at 9:46