Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

melange: fix optional shape codegen bug #700

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Unreleased
- [melange]: remove old, unused CLI flags: `-bs-ns`, `-bs-cmi`, `-bs-cmj`,
`-bs-no-builtin-ppx`, `-bs-super-errors`
([#686](https://github.com/melange-re/melange/pull/686)).
- [melange]: generate correct code for types with the `option` shape
([#700](https://github.com/melange-re/melange/pull/700)).

1.0.0 2023-05-31
---------------
Expand Down
26 changes: 13 additions & 13 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jscomp/test/dist/jscomp/test/gpr_5169_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/option_encoding_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions test/blackbox-tests/option-shape.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

$ . ./setup.sh
$ cat > x.ml <<EOF
> module X = struct
> type 'a t = 'a option = None | Some of 'a
> end
> let () = match X.None with Some _ -> Js.log "A BUG!" | None -> Js.log "OK"
> EOF

$ melc -ppx melppx x.ml
// Generated by Melange
'use strict';


var X = {};

console.log("OK");

exports.X = X;
/* Not a pure module */
2 changes: 1 addition & 1 deletion vendor/melange-compiler-libs