Well, that's the nature of function overloading. It's not normally an issue 
because the problem only applies to procedures with the exact same name that 
relies on int literals not having a concrete type. It's a very small scenario, 
and personally I don't think I've ever come across loading a library changing 
the behavior like that.

And @Stefan_Salewski, not quite sure what you don't like about it. ElegantBeef 
explained this in a bit more detail. Essentially it goes something like this:
    
    
    5 # This is an undetermined int literal
    var x: float = 5 # Now the int literal is required to be turned into a 
float, which is fine, because it's an undetermined int literal
    var y = 5 # Now the undetermined int literal needs to take on a concrete 
type and chooses the default one, an int, since no type is required.
    echo typeof(5) # Typeof can't return "I don't know" so the undetermined int 
literal once again have to choose a type, and goes with the default.
    var f = [1.0, 4.2, 5] # The undetermined int literal again turns into a 
float, because it is requested to be one
    
    
    Run

The reason for this tiny pseudo-type is simply to allow us to type less, and it 
rarely creates bugs. The above could certainly have been avoided by choosing 
the default type in an ambiguous situation (same as it does in `var y = 5`) so 
I guess this could be considered one such bug.

Reply via email to