expression property

  1. @experimental
Expression get expression

The expression that follows the atSign.

The syntax of an annotation is fixed: identifier ('.' identifier)? typeArguments? ('.' identifier)? arguments?. With arguments, the expression is always a ConstructorInvocation, even before resolution. Without arguments, the parser produces a chain of ParsedUnqualifiedName, ParsedNameAccess, and ParsedTypeArguments, which resolution replaces, depending on what the names denote, with:

An annotation is resolved like the same expression written without a keyword in a constant context. A valid annotation is either a read of a constant variable or an invocation of a constant constructor. For any other expression resolution reports a diagnostic, and the annotation has no value.

Implementation

@experimental
Expression get expression;