-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestanalyzer-constantsarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.dart-model-analyzer-specIssues with the analyzer's implementation of the language specIssues with the analyzer's implementation of the language spec
Description
With the recent change the following code produces and error in CFE but no error in the analyzer.
const String? c1 = null;
const int? c2 = c1 == null ? null : c1?.length; // Error: Null-aware property access can't be used in a constant expression.
main() {
print(c2);
}
@eernstg please confirm that there should be an analyzer error as well.
Dart SDK version: 3.9.0-edge.cddee72854b2c735148751f08eb0cc51d05854c9 (main) (Mon May 5 01:50:25 2025 -0700) on "linux_x64"
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestanalyzer-constantsarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.dart-model-analyzer-specIssues with the analyzer's implementation of the language specIssues with the analyzer's implementation of the language spec