Steve, I understand how it actually works (your explanation); my concern is that this is "broken as designed" because the behavior is unpredictable unless you know the actual values being passed at any given call. I'm not asking for strong typing (a la Pascal) - but I should be able to determine what will happen on a call by inspection, without having to know what the actual value is at run time. If I have a sub
and DoSomething expects Ecks to be a numeric type - integer, single, or double - and it tries to modify Ecks mathematically, there's nothing stopping me from writing the bogus code
Em = "A String"
DoSomething Em
Which should blow up in my face because I can't do math on "A String".
Arguably, it's my responsibility as codemonger to do input validation before passing data to subroutines/functions - but there's a difference between doing the basic bookkeeping of variable and parameter types versus validating e.g., that the input has only valid characters, matches a (regex) pattern, is within a specified numeric range, etc.
I contend that a compiler that doesn't do the bookkeeping has to be considered 'broken as designed'. Especially if I want to write libraries for general use, where I have NO control over what's passed in. Or use those created by others, which more often than not are poorly documented if documented at all.