Up to this point, we have not discussed types in any detail. We have been able to delay the discussion until now because Dart is optionally typed. In this chapter, we shall describe Dart’s types, filling in many gaps in the story we have presented so far. We begin by explaining optional typing, perhaps Dart’s most unusual characteristic.
As noted in the introduction, a language is optionally typed if, and only if:
• Types are syntactically optional.
• Types have no effect on runtime semantics.
The latter point is far more significant than the former. Those accustomed to traditional statically typed languages may find this disconcerting at first. The point is subtle but crucial. It is a cornerstone of the ...