Files
sdk/tests/language/list/literal6_test.dart
T
Brian Wilkerson 6b3f3403ec Unify three diagnostic codes for documentation purposes
Change-Id: I46326160fedb26c92843698dd6513b9fe87e32dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169041
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-26 04:24:55 +00:00

20 lines
594 B
Dart

// Copyright (c) 2019, 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.
/// Dart test program const map literals.
class ListLiteral2NegativeTest<T> {
test() {
// Type parameter is not allowed with const.
var m = const <T>[];
// ^
// [analyzer] COMPILE_TIME_ERROR.INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL
// [cfe] Type variables can't be used as constants.
}
}
main() {
ListLiteral2NegativeTest<int>().test();
}