Talk:Weak typing

From Wikipedia, the free encyclopedia

[edit] typedef does not introduce a new type, just an alias

so this cannot be used as an example of a weak typing.

I took this out. Not only does typedef just introduce an alias, but the example as given is nonsensical. "typedef int Date;" gives you no indication (formal or informal) of how this "Date" is supposed to be stored as an integer, so as an example of typing it's inherently flawed. If you want a proper example, you could use Pascal's subrange types, which however don't exist in C. Enums come closest to a subtyping issue.
The example assigning an integer 5 to a float is also weak, because this particular conversion is guaranteed to succeed with no loss of precision. It would be counterproductive for the compiler to warn about it. 82.95.254.249 15:20, 10 August 2007 (UTC)