CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST constant

CompileTimeErrorCode const CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST

10.6.3 Constant Constructors: It is a compile-time error if a constant constructor is declared by a class C if any instance variable declared in C is initialized with an expression that is not a constant expression.

Parameters: 0: the name of the field

Implementation

CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST =
CompileTimeErrorCode(
    'CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST',
    "Can't define the const constructor because the field '{0}' "
        "is initialized with a non-constant value.",
    correction: "Try initializing the field to a constant value, or "
        "removing the keyword 'const' from the constructor.")