8.1 Static Information
A binding or an expression can have associated static information that is used to enable, reject (in use_static mode), or resolve certain expression forms. For example, an expression to the left of a . can have static information to specify how a field name after . resolves to an field accessor. See the Annotations and the Dot Operator for an introduction to static information and its role.
Static information is associated to a binding through a binding operator, and it can be associated to an expression through a binding that it uses or through an expression form that adds static information to its parsed form (i.e., expansion). For example, the :: operator associates static information through an annotation. An annotation, meanwhile, pairs a predicate with a set of static information to associate with any variable that is bound with the annotation. That’s why a binding p :: Posn makes every reference to p a dot provider: the annotation Posn indicates that every binding with the annotation gets a dot provider to access the x and y fields of Posn. When :: is used in an expression, then static information indicated by the annotation is similarly associated with the overall :: expression, which is why e :: Posn is a dot provider for any expression e. Function-call forms and map-reference forms similarly attach static information to their parsed forms, sometimes, based on static information attached to the function or map subexpression.
Static information is associated with an expression, not a value. So, if Posn is passed as an argument to a function (instead of being called directly as a constructor), then the function ultimately receives a value and knows nothing of the expression that generated the value. That is, no part of the function’s implementation can take advantage of the fact that directly calling Posn would have formed a dot provider. The function might have an annotation on its argument that indicates a dot-provider constructor, but that’s a feature of the formal argument, and not of an actual value.