You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The const [1, 2] can be canonicalized at compile time.
OK.
const y = x[0];
The x[0] can NOT be canonicalized at compile time.
FAIL.
P.S.
The const in Dart means not only constant.
The const in Dart also means can be canonicalized.
How in Dart possible canonicalize the indexed array operation?
P.S.
#1
1 == 1
Const.
Can be canonicalized.
#2
Colors.RED == Colors.RED
Const.
Can NOT be canonicalized.
What means "elements" of something (not only elements of the "List")?
This means a value which are the result of the operator "[]".
Is this possible in Dart (const V operator [K index])?
const x = const [1, 2];
const INDEX = x[1];
const y = x[INDEX];
const z = x[666];
const x = const [1, 2];
const y = x[0];
yields
"error: ... expression is not a valid compile-time constant"
looks pretty constant to me. i don't see how it's much different from
const x = 1;
const y = x + 1;
which is allowed.
Dart VM version: 1.6.0-dev.5.1 (Thu Jul 24 19:35:53 2014) on "linux_x64"
The text was updated successfully, but these errors were encountered: