RETURN_IN_GENERATIVE_CONSTRUCTOR constant

CompileTimeErrorCode const RETURN_IN_GENERATIVE_CONSTRUCTOR

13.12 Return: It is a compile-time error if a return statement of the form return e; appears in a generative constructor.

Implementation

static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR =
    CompileTimeErrorCode('RETURN_IN_GENERATIVE_CONSTRUCTOR',
        "Constructors can't return values.",
        correction: "Try removing the return statement or using a factory "
            "constructor.")