ANNOTATION_WITH_NON_CLASS constant

CompileTimeErrorCode const ANNOTATION_WITH_NON_CLASS

15 Metadata: The constant expression given in an annotation is type checked and evaluated in the scope surrounding the declaration being annotated.

16.12.2 Const: It is a compile-time error if T is not a class accessible in the current scope, optionally followed by type arguments.

16.12.2 Const: If e is of the form const T.id(a1, …, an, xn+1: an+1, … xn+k: an+k) it is a compile-time error if T is not a class accessible in the current scope, optionally followed by type arguments.

Parameters: 0: the name of the non-type element

Implementation

static const CompileTimeErrorCode ANNOTATION_WITH_NON_CLASS =
    CompileTimeErrorCode(
        'ANNOTATION_WITH_NON_CLASS', "The name '{0}' isn't a class.",
        correction: "Try importing the library that declares the class, "
            "correcting the name to match a defined class, or "
            "defining a class with the given name.")