dart-sdk/docs/language
Lasse R.H. Nielsen 2a0cc74db1 Expand the definition of potentially constant expression.
The current definition requires the expression to be valid and
compile-time constant if constructor parameters are considered
compile-time constants with types appropriate for their context.

This is necessary but not sufficient, so this CL adds the further
requirement that the expression must also be a valid (not necessarily
constant) expession if the parameters are considered non-constant
variables.

This rules out the case:

    const C(x) : y = const [x];

where the current specification would, technically, allow it as a
potentially constant expression and therefore be a valid const
constructor. In practice it would never work if the constructor is
used with "new" instead of "const".

This is not really a specification *change* - existing implementations has this restriction anyway.

Addressed the concern of #24970.
BUG= http://dartbug.com/24970
R=eernst@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org/1465473002 .
2016-01-20 13:21:39 +01:00
..
dart.sty
dartLangSpec.tex Expand the definition of potentially constant expression. 2016-01-20 13:21:39 +01:00
Makefile Specify behavior of e?.v++ and e?.v-- 2015-06-11 15:01:06 -07:00