-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
analyzer-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.model-const-evalImplementation of constant evaluation in analyzer/cfeImplementation of constant evaluation in analyzer/cfestatus-pending
Description
The code below produce an error in the analyzer and no issues in CFE
class C {
static C one = const C(1); // Note, one is not a constant
static const C two = const C(2);
final int v;
const C(this.v);
}
main() {
const c = 2 > 1 ? C.two : C.one; // Analyzer error. Const variables must be initialized with a constant value.
}
There should be no this error in the analyzer.
cc @eernstg to confirm.
Metadata
Metadata
Assignees
Labels
analyzer-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.model-const-evalImplementation of constant evaluation in analyzer/cfeImplementation of constant evaluation in analyzer/cfestatus-pending