Skip to main content

Questions tagged [type-safety]

Filter by
Sorted by
Tagged with
15 votes
5 answers
2k views

When can widening conversions cause problems?

I can understand the reason for raising a warning or error when you try to convert a wider integer type to a narrower one, due to the loss of precision. Some C compilers will warn about this: ...
CPlus's user avatar
  • 9,063
9 votes
4 answers
2k views

What are the approaches of protecting against partially initialized objects?

An object is partially initialized if the program execution didn't exit their constructor yet. Usually the programmer is responsible for not leaving partially initialized objects in unwanted places ...
user23013's user avatar
  • 2,740
-7 votes
3 answers
434 views

What's the point of type safety? [closed]

It has been advertised that in type-safe languages, well-typed programs never go wrong, but this doesn't like a legit statement to me: Array indexing is usually by int, but we can freely send out of ...
ice1000's user avatar
  • 2,634