RETURN_IN_GENERATOR constant

CompileTimeErrorCode const RETURN_IN_GENERATOR

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

Implementation

static const CompileTimeErrorCode RETURN_IN_GENERATOR = CompileTimeErrorCode(
    'RETURN_IN_GENERATOR',
    "Can't return a value from a generator function (using the '{0}' "
        "modifier).",
    correction: "Try removing the value, replacing 'return' with 'yield' or "
        "changing the method body modifier.")