mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 02:17:14 +00:00
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:
parent
9e296e1553
commit
a6fe06af36
|
@ -8,41 +8,49 @@
|
||||||
// constant expressions or potentially constant type expressions.
|
// constant expressions or potentially constant type expressions.
|
||||||
|
|
||||||
class A<X> {
|
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()
|
const A()
|
||||||
: x1 = const [X],
|
: x1 = const [X],
|
||||||
//^
|
//^
|
||||||
// [analyzer] unspecified
|
// [analyzer] unspecified
|
||||||
// [cfe] unspecified
|
// ^
|
||||||
|
// [cfe] Type variables can't be used as constants.
|
||||||
x2 = const <X>[],
|
x2 = const <X>[],
|
||||||
//^
|
//^
|
||||||
// [analyzer] unspecified
|
// [analyzer] unspecified
|
||||||
// [cfe] unspecified
|
// ^
|
||||||
|
// [cfe] Type variables can't be used as constants.
|
||||||
x3 = const {X},
|
x3 = const {X},
|
||||||
//^
|
//^
|
||||||
// [analyzer] unspecified
|
// [analyzer] unspecified
|
||||||
// [cfe] unspecified
|
// ^
|
||||||
|
// [cfe] Type variables can't be used as constants.
|
||||||
x4 = const <X>{},
|
x4 = const <X>{},
|
||||||
//^
|
//^
|
||||||
// [analyzer] unspecified
|
// [analyzer] unspecified
|
||||||
// [cfe] unspecified
|
// ^
|
||||||
|
// [cfe] Type variables can't be used as constants.
|
||||||
x5 = const {X: null},
|
x5 = const {X: null},
|
||||||
//^
|
//^
|
||||||
// [analyzer] unspecified
|
// [analyzer] unspecified
|
||||||
// [cfe] unspecified
|
// ^
|
||||||
|
// [cfe] Type variables can't be used as constants.
|
||||||
x6 = const <X, String?>{},
|
x6 = const <X, String?>{},
|
||||||
//^
|
//^
|
||||||
// [analyzer] unspecified
|
// [analyzer] unspecified
|
||||||
// [cfe] unspecified
|
// ^
|
||||||
|
// [cfe] Type variables can't be used as constants.
|
||||||
x7 = const B<X>(),
|
x7 = const B<X>(),
|
||||||
//^
|
//^
|
||||||
// [analyzer] unspecified
|
// [analyzer] unspecified
|
||||||
// [cfe] unspecified
|
// ^
|
||||||
|
// [cfe] Type variables can't be used as constants.
|
||||||
x8 = const C(X);
|
x8 = const C(X);
|
||||||
//^
|
//^
|
||||||
// [analyzer] unspecified
|
// [analyzer] unspecified
|
||||||
// [cfe] unspecified
|
// ^
|
||||||
|
// [cfe] Type variables can't be used as constants.
|
||||||
}
|
}
|
||||||
|
|
||||||
class B<X> {
|
class B<X> {
|
||||||
|
|
Loading…
Reference in a new issue