4.3 Identifiers

When an expression is an IdentifierReference, the expression refers to the most nested namespace, class, enum, function, variable, or parameter with that name whose scope (section 2.4) includes the location of the reference. The type of such an expression is the type associated with the referenced entity:

  • For a namespace, the object type associated with the namespace instance.
  • For a class, the constructor type associated with the constructor function object.
  • For an enum, the object type associated with the enum object.
  • For a function, the function type associated with the function object.
  • For a variable, the type of the variable.
  • For a parameter, the type of the parameter.

An identifier expression that references a variable or parameter is classified as a reference. An identifier expression that references any other kind of entity is classified as a value (and therefore cannot be the target of an assignment).