diff options
| author | Alasdair Armstrong | 2017-12-07 18:54:22 +0000 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-12-07 19:00:01 +0000 |
| commit | a3d355144d9e5f3dd68376ec77f93ed756a03820 (patch) | |
| tree | f61c14e2dbf3b1896dc3d8c04bd67582658868a0 /src/parser2.mly | |
| parent | 19386b2b3e595e4b5bc95dfd06fb9d32d786143e (diff) | |
Fix regressions in OCaml output
Recent patches have made the rewriter more strict about performing
type correct rewrites. This is mostly a good thing but did cause some
problems with the ocaml backend.
Currently the sizeof rewriter doesn't seem to preserve type
correctness - I suspect this is because when it resolves the sizeofs,
it generates constraints that are true, but not in a form where the
typechecker can see that they are true. I disabled the re-check after
the sizeof rewriting pass to fix this. Maybe we don't want to do this
anyway because it's slow.
Changes to function clauses with guards + monomorphisation changed how
the typechecker handles literal patterns. I added a rewriting pass to
rewrite literals to guarded equality checks, which is run before
generating ocaml.
The rewriter currently uses Env.empty in a view places. This can cause
bugs because Env.empty is a totally unitialised environment that
doesn't satisfy invariants we expect of an environment. This should be
changed to initial_env and it shouldn't be exported, I fixed a few
cases where this caused things to go wrong, but it should probably not
be exported from Type_check.ml.
Diffstat (limited to 'src/parser2.mly')
0 files changed, 0 insertions, 0 deletions
