AWAIT_IN_WRONG_CONTEXT constant

CompileTimeErrorCode const AWAIT_IN_WRONG_CONTEXT

16.30 Await Expressions: It is a compile-time error if the function immediately enclosing a is not declared asynchronous. (Where a is the await expression.)

Implementation

static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT =
    CompileTimeErrorCode('AWAIT_IN_WRONG_CONTEXT',
        "The await expression can only be used in an async function.",
        correction:
            "Try marking the function body with either 'async' or 'async*'.")