From 930dbfa893fbf508cc5ee0bb5be880b887ca661a Mon Sep 17 00:00:00 2001 From: sgrekhov Date: Thu, 17 Apr 2025 11:36:52 +0300 Subject: [PATCH] Fixes #3122. Update constants evaluation according to the specification --- .../constant_expression_A10_t17.dart | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/LanguageFeatures/Static-access-shorthand/constant_expression_A10_t17.dart b/LanguageFeatures/Static-access-shorthand/constant_expression_A10_t17.dart index 0f11f2a555..e392584bcf 100644 --- a/LanguageFeatures/Static-access-shorthand/constant_expression_A10_t17.dart +++ b/LanguageFeatures/Static-access-shorthand/constant_expression_A10_t17.dart @@ -45,14 +45,10 @@ main() { // ^ // [analyzer] unspecified // [cfe] unspecified - const M m = 2 < 1 ? .one : .two; -// ^ -// [analyzer] unspecified -// [cfe] unspecified - const E e = 2 > 1 ? .one : .two; -// ^ -// [analyzer] unspecified -// [cfe] unspecified + const M m = 2 < 1 ? .one : .two; //`false ? variable : const` is a constant + + const E e = 2 > 1 ? .one : .two; // `true ? const : variable` is a constant + const ET et = 2 < 1 ? .one : .two; // ^ // [analyzer] unspecified