The code below should compile and work, but it does not. I am not sure why. I tried to play around but so far I could only identify that this bug happens if the two function overloads are in the form name + nameSuffixed. Best to debug the compiler to see what exactly is going on there. Trial and error lead me nowhere sadly. This only seemed to happen if I have a number convertible type as an overload (int, float, bool). String does not trigger the problem. Different function name variants or different parameters seem to indicate that functions are being confused by the end of their name? s. Comments below on this issue for more examples.
class OMG_HOW_DID_THIS_HAPPEN { void Equals(int comparisonValue) { } void Equals(float comparisonValue) { } void LessThanOrEquals(int comparisonValue) { } void LessThanOrEquals(float comparisonValue) { } } void Bruh() { OMG_HOW_DID_THIS_HAPPEN inst(); inst.Equals(42.323); }
SCRIPT (E): @"Scripts/Game/test.c,23": Ambiguous function call 'Equals', candidates:
SCRIPT (E): @"Scripts/Game/test.c,23": Equals(float)
SCRIPT (E): @"Scripts/Game/test.c,23": Equals(float)
SCRIPT (E): @"Scripts/Game/test.c,23": Can't find matching overload for function 'Equals'
SCRIPT (E): Can't compile "Game" script module!Scripts/Game/test.c(23): Ambiguous function call 'Equals', candidates: