-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failurescustomer-dart2jslegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.
Milestone
Description
When enabling constant-update-2018, the following code:
const int x = 0;
const List<int> l = const [
1,
-x,
];
main() => print(l);used to compile cleanly, but with the flag produces a compile time error:
bad_const.dart:5:3:
Error: Expected constant '-0.0' to be of type 'int', but was of type 'double'.
-x,
^
bad_const.dart:8:17:
Info: While analyzing:
main() => print(l);
^
bad_const.dart:3:21:
Error: Constant expression depends on itself.
const List<int> l = const [
^
bad_const.dart:3:17:
Info: While analyzing:
const List<int> l = const [
^
Error: Compilation failed.
Finished with a exit code: 1
@fishythefish can you take a first look - this unfortunately breaks existing code.
Metadata
Metadata
Assignees
Labels
P1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failurescustomer-dart2jslegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.