improved error messages for fixed row polymorphic variants: keep track of the motivation behind a fixed row (e.g it was bound to an universal or existential type variable, or private) in the types themselves and use this explanation in error messages.
- The code responsible for printing Syntaxerr errors is moved to the
Parse module (so that it can depend on the variable printer in
Pprintast).
- Pprintast becomes a dependency for a few tools that link some
compiler modules in an ad hoc way (they would better be implemented
in terms of compiler-libs).
Type variables whose name has a single quote as the second character
(such as ' a' or ' a'b) need to be printed with a whitespace after the
initial quote symbol, in order not to be confused with a character
literal.
The concrete syntax only allows attributes on tags/constructors/fields
(Rtag, Otag), not on inherited subtypes (Rinherit, Oinherit); we add
this as new enforced invariant in ast_invariants.
Florian Angeletti and myself ran into a problem when trying to use attributes
for ellision of parts of manual example. We wanted to be turn any ast-node
marked with the [@ellipsis] attribute into "..." in the rendering of the
corresponding code block, but for this we need the location of the
attributed node, and it turns out that some constructions supported
attributes without carrying a location:
- Rtag in row_field
- Otag in object_field
- type_exception record
- type_extension record
We added locations in all those positions, guaranteeing the invariant
that all nodes to which attributes can be attached have a precise
position.
* Fix MPR#7726 by re-checking recursive modules in signatures after substitution
* Check module applications when translating types in Typetexp
* Check all results of functor applications lazily
* Reduce the overhead of checking module types by building the environment lazily
Deprecation warning (3) is currently only reported when directly
accessing a component marked with the deprecated attribute; but it is
missed when we coerce the signature contaning the deprecated component
to a signature without the attribute.
This commit adds the required machinery to detect such cases
and report the same warning. (An alternative design could be
to introduce a new warning for that purpose.)
Some of the new machinery could be used for other purposes:
- During the inclusion check, keep the location that would used in
the error message if the check fails.
- Warnings can now hold extra "sub-locations" (and associated
messages).