-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: show bug compiling custom
true
/ false
constructors
- Loading branch information
1 parent
fa047d9
commit 7cad3bf
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Demonstrate redefining the `true` / `false` constructors | ||
|
||
$ . ./setup.sh | ||
$ cat > x.ml <<EOF | ||
> type t = A | true | false | ||
> let z : t = A | ||
> let x : t = true | ||
> let y : t = false | ||
> let t : bool = false | ||
> EOF | ||
$ melc -ppx melppx x.ml | ||
// Generated by Melange | ||
'use strict'; | ||
const z = /* A */0; | ||
const x = true; | ||
const y = true; | ||
const t = false; | ||
exports.z = z; | ||
exports.x = x; | ||
exports.y = y; | ||
exports.t = t; | ||
/* No side effect */ |