3 ms·
Type inference works only when the types are unambiguous - arrays don't support indexing by anything else. With strict typing and very few implicit conversions
by pornel 7y ago
Type inference works only when the types are unambiguous - arrays don't support indexing by anything else. With strict typing and very few implicit conversions in the language it works very well without surprises. You can still declare types ahead of time if you want to.
- xscott 7y ago> Type inference works only when the types are unambiguous It looks to me like when the types are ambiguous (because nothing placed a restriction on them), integer literals become 32 bit and floating literals become 64 bit. Then quietly, later when you add a restriction, the code above (which you've already worked through one line at a time with debug statements and all) changes from underneath you. > You can still declare types ahead of time if you want to. When the implicit stuff is surprising, I'd rather it wasn't ever implicit.