Fix language/const/constant_type_variable_error_test

Change-Id: I8f2c65485d694db1a831f6778e3b6a03c280c638
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216288
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Johnni Winther 2021-10-12 16:06:09 +00:00 committed by commit-bot@chromium.org
parent 9e296e1553
commit a6fe06af36

View file

@ -8,41 +8,49 @@
// constant expressions or potentially constant type expressions.
class A<X> {
final Object x1, x2, x3, x4, x5, x6, x7, x8, x9;
final Object x1, x2, x3, x4, x5, x6, x7, x8;
const A()
: x1 = const [X],
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [cfe] Type variables can't be used as constants.
x2 = const <X>[],
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [cfe] Type variables can't be used as constants.
x3 = const {X},
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [cfe] Type variables can't be used as constants.
x4 = const <X>{},
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [cfe] Type variables can't be used as constants.
x5 = const {X: null},
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [cfe] Type variables can't be used as constants.
x6 = const <X, String?>{},
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [cfe] Type variables can't be used as constants.
x7 = const B<X>(),
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [cfe] Type variables can't be used as constants.
x8 = const C(X);
//^
// [analyzer] unspecified
// [cfe] unspecified
// ^
// [cfe] Type variables can't be used as constants.
}
class B<X> {