In MX we can have overriding methods. So something like this is ok
Monkey
1
2
3
Method SetValue:void(a:Int,b:Int)
Method SetValue:Void(a:Float,b:Float)
But, if I call like this
Monkey
1
2
3
self.SetValue(1)
self.SetValue(1,2.5)
it reports an error – because you need to ‘pass’ the ‘rights’ parameters (in the last line : 1.0 2.5)
I was thinking, there’s a way to ‘force’ the compiler to use a determinate method? Maybe a special keyword like ‘Use 1’ (where’s the number refers to the method #1), or a sort of ‘Default’ keyword to makes it the preferred one.
I know it’s redundant (it’s faster to type 1.0,2.5 ) but maybe something like
Monkey
1
Method SetValue:Void(a:Float,b:Float)Default
should be implemented to ‘force’ to use this in case of misinterpretation – maybe with a ‘warning’ that a ‘conversion from INT to FLOAT to match the overriding method is done…)
Just an idea (and maybe it’s already implemented !)