moonsharp icon indicating copy to clipboard operation
moonsharp copied to clipboard

Shouldn't EXACT_MATCH score higher than CUSTOM_CONVERTER_MATCH?

Open oxysoft opened this issue 5 years ago • 0 comments

I noticed something strange about MoonSharp while debugging a bug in our game. Both of these weights for overload resolving are calibrated to 100:

https://github.com/moonsharp-devs/moonsharp/blob/4e748a7a74af04b589af1b3e1aaa2d66d8b36a57/src/MoonSharp.Interpreter/_Projects/MoonSharp.Interpreter.netcore/src/Interop/Converters/ScriptToClrConversions.cs#L9Ohttps://github.com/moonsharp-devs/moonsharp/blob/4e748a7a74af04b589af1b3e1aaa2d66d8b36a57/src/MoonSharp.Interpreter/_Projects/MoonSharp.Interpreter.netcore/src/Interop/Converters/ScriptToClrConversions.cs#L9-L10

Shouldn't an exact match score higher? Otherwise, this can cause ScriptRuntimeException due to argument mismatch (cannot convert X to a CLR Y etc.) when adding custom converters for UserData to UserData. (userdata to another userdata)

oxysoft avatar Jan 15 '21 19:01 oxysoft