3 ms·
> And type annotations in Dart are optional - when programmers are not obliged to use them, guess what will happen? The type system will infer a static type ba
by munificent 8y ago
> And type annotations in Dart are optional - when programmers are not obliged to use them, guess what will happen?
The type system will infer a static type based on the type of the initializer.
In some cases, inference may fail to infer a type. Right now, that can silently give you dynamic, but there's a flag to make that an error. I expect before too long that will be the default behavior.