Skip to content

Commit 1cc496d

Browse files
authored
Fixes #3122. Update constants evaluation according to the specification (#3150)
1 parent 6ff5ec3 commit 1cc496d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

LanguageFeatures/Static-access-shorthand/constant_expression_A10_t17.dart

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,10 @@ main() {
4545
// ^
4646
// [analyzer] unspecified
4747
// [cfe] unspecified
48-
const M m = 2 < 1 ? .one : .two;
49-
// ^
50-
// [analyzer] unspecified
51-
// [cfe] unspecified
52-
const E e = 2 > 1 ? .one : .two;
53-
// ^
54-
// [analyzer] unspecified
55-
// [cfe] unspecified
48+
const M m = 2 < 1 ? .one : .two; //`false ? variable : const` is a constant
49+
50+
const E e = 2 > 1 ? .one : .two; // `true ? const : variable` is a constant
51+
5652
const ET et = 2 < 1 ? .one : .two;
5753
// ^
5854
// [analyzer] unspecified

0 commit comments

Comments
 (0)