The Tpat_exception case would make several calls to the continuation
'k', which must be used linearily -- exactly once.
This bug is harmless and hard to reach today because Tpat_exception is
mostly used at the toplevel or under an or-pattern, where the
continuation is the identity. But the type-checker still allows
Ppat_constraint and Ppat_open nodes above exception-patterns, allowing
to observe the duplication. And maybe more tomorrow?
$ ocaml -dsource
# fun f x -> match f x with _ -> () | (exception _ : exn) -> ();;
[...]
pattern
Tpat_constraint
core_type
Ttyp_constr "exn/7!"
[]
pattern
Tpat_exception
pattern
Tpat_constraint
core_type
Ttyp_constr "exn/7!"
[]
pattern
Tpat_any
[...]
# fun f x -> match f x with _ -> () | Stdlib.(exception _) -> ();;
[...]
pattern
Tpat_open ""Stdlib!""
pattern
Tpat_exception
pattern
Tpat_open ""Stdlib!""
pattern (//toplevel//[1,0+42]..//toplevel//[1,0+43])
Tpat_any
[...]
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.
Persistent_env is a new module that handles the relation between the
type-checking state and the "persistent" typing information laying in
.cmi files on the filesystem. In particular, it handles the collection
and production of CRC information for the .cmi files being read and
written to the filesystem; the using modules (in our case, only Env)
are in charge of turning the cmi files into higher-level information
(components and signatures).
Persistent_env exposes a type `'a t` of a persistent environment,
which acts as a mutable store of `'a` values. There is no global state
in the module itself: while Env (and thus the OCaml type-checker) uses
a single global persistent environment, it should be possible to
create several independent environments to represent, for example,
several independent type-checking sessions.
* open struct: add a failing test for expansiveness checking
* bug fix: 'open M' should only be non-expansive if 'M' is.
* open struct expansiveness fix: Changes entry
Previously, not having a scope meant the type was used in every context,
now we set the scope to "Btype.lowest_level" to mean the same thing.
The equivalence was made obvious by the recent changes to identifiers
scoping.