mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:19:48 +00:00
ae4543fcb9
Closes #46925 Change-Id: I81e97cae05c39c24b24dae82a222f857d4730ac7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210465 Reviewed-by: Jens Johansen <jensj@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
22 lines
570 B
Dart
22 lines
570 B
Dart
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// Check that const objects (including literals) are immutable.
|
|
|
|
// Must be 'const {}' to be valid.
|
|
invalid(
|
|
[var p =
|
|
/*
|
|
const
|
|
*/
|
|
{}]) {}
|
|
// ^^
|
|
// [analyzer] COMPILE_TIME_ERROR.NON_CONSTANT_DEFAULT_VALUE
|
|
// [cfe] Constant expression expected.
|
|
// [cfe] Non-constant map literal is not a constant expression.
|
|
|
|
main() {
|
|
invalid();
|
|
}
|