O'Reilly logo

The Dart Programming Language by Gilad Bracha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Types

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.

5.1 Optional Typing

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required