INITIALIZING_FORMAL_FOR_STATIC_FIELD constant

CompileTimeErrorCode const INITIALIZING_FORMAL_FOR_STATIC_FIELD

7.6.1 Generative Constructors: An initializing formal has the form this.id. It is a compile-time error if id is not the name of an instance variable of the immediately enclosing class.

Parameters: 0: the name of the initializing formal that is a static variable in the immediately enclosing class

See INITIALIZER_FOR_STATIC_FIELD.

Implementation

static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD =
    CompileTimeErrorCode(
        'INITIALIZING_FORMAL_FOR_STATIC_FIELD',
        "'{0}' is a static field in the enclosing class. Fields initialized "
            "in a constructor can't be static.",
        correction: "Try removing the initialization.")