0808d29b4e33c303bf40524407a6e331c7a439f8
The existing specification was underspecifying potentially constant expressions, effectively relying on evaluation to determine whether an expression was potentially constant. This change specifies potentially constant recursively using only the syntax of the expressions. Adds short-circuting to `?:`, `??`, `||` and `&&` expressions, so for `String x`, the expression `x != null && x.length > 0` is compile-time constant. The original specification requred evaluation of the latter half even when `x` is null. We can now avoid this because we can require that the unused expression is a potentially constant expression without having to check if it, or any part of it, is a compile-time constant expression. Allows `x == null` and `x != null` as compile-time constant expression independently of the type of `x`. Allows `e as T` as a compile-time constant expression. Types are more important in Dart 2, so you need a way to adjust typing in some cases, even in compile-time constant expressions. Change-Id: I02bf0b77013c3b3ced8cd46334db378787cc2d57 Reviewed-on: https://dart-review.googlesource.com/36220 Commit-Queue: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Erik Ernst <eernst@google.com> Reviewed-by: Leaf Petersen <leafp@google.com>
…
…
…
…
Dart
Dart is an open-source, scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps.
Using Dart
Visit the dartlang.org to learn more about the language, tools, getting started, and more.
Browse pub.dartlang.org for more packages and libraries contributed by the community and the Dart team.
Building Dart
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
Contributing to Dart
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.
License & patents
Description
Languages
Dart
84.6%
C++
13%
Python
0.7%
JavaScript
0.5%
HTML
0.4%
Other
0.5%