Overloaded argument Type widening :-)

BlitzMax Forums/Brucey's Modules/Overloaded argument Type widening :-)

Brucey(Posted 2016) [#1]
I've decided to base this generally on Java's rules ( https://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.1.2 ) with the addition of allowing up-casting to String (as is currently supported by BlitzMax).

In addition, the unsigned types (size_t, UInt and ULong) probably can be widened to their signed equivalents, but not vice-versa (as a negative int would lose sign widening to ULong, for example).

In Java, long -> float is supported. Not sure this should be true in BlitzMax or not. Will leave it in for now.


Any thoughts on this?
(probably only answer if you understand what this is all about :-)


Henri(Posted 2016) [#2]
Hi,

at first glance this seems like normal conversion rules when someone passes a differing primitive type over what is defined in Function/Method - params ?

-Henri