Skip to content

Commit c1c8ff8

Browse files
committed
dart-lang#3122. Expect an error in case of non-constant in a constant expression
1 parent e8f837d commit c1c8ff8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

LanguageFeatures/Static-access-shorthand/constant_expression_A10_t17.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,15 @@ main() {
4545
// ^
4646
// [analyzer] unspecified
4747
// [cfe] unspecified
48-
const M m = 2 < 1 ? .one : .two; //`false ? variable : const` is a constant
48+
const M m = 2 < 1 ? .one : .two;
49+
// ^
50+
// [analyzer] unspecified
51+
// [cfe] unspecified
4952

50-
const E e = 2 > 1 ? .one : .two; // `true ? const : variable` is a constant
53+
const E e = 2 > 1 ? .one : .two;
54+
// ^
55+
// [analyzer] unspecified
56+
// [cfe] unspecified
5157

5258
const ET et = 2 < 1 ? .one : .two;
5359
// ^

0 commit comments

Comments
 (0)