Closed powercode closed 1 year ago
:partying_face:
The algorithm for determining the best match is a hack right now.
It would be good to create tests documenting the desired behavior and then implement a more structured version with precise rules for determining "goodness".
Defining "goodness" would be a desired wish.
Thx, for the hard work. I will check it over the weekend*. And will push a beta version to nuget.
I fixed the style a little.
`* Edit it might be took a little longer.
Reworking how FindMethod works.
There are for sure some cleanup that could be done, but now all test cases pass.
I've also added new specific tests for FindMethod in LuaEmitTests.cs.
High level changes are to make FindMethod first filter members to only include valid overloads, and then pass them to the next stage where the best match is determined.
This is done by using penalties for different kinds of conversion, where the method with the lowest penalty is selected. The algorithm can surely be improved.