-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: demonstrate redundant check in reason-react-ppx
- Loading branch information
1 parent
be16181
commit 30fec6b
Showing
1 changed file
with
34 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,34 @@ | ||
Demonstrate how to use the React JSX PPX | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.8) | ||
> (using melange 0.1) | ||
> EOF | ||
|
||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (target output) | ||
> (alias mel) | ||
> (emit_stdlib false) | ||
> (libraries reason-react) | ||
> (preprocess (pps melange.ppx reason-react-ppx))) | ||
> EOF | ||
|
||
$ cat > x.re <<EOF | ||
> module App = { | ||
> [@react.component] | ||
> let make = (~myProp: bool=?) => React.null; | ||
> }; | ||
> EOF | ||
|
||
$ dune build @mel | ||
File "x.re", line 3, characters 15-27: | ||
3 | let make = (~myProp: bool=?) => React.null; | ||
^^^^^^^^^^^^ | ||
Warning 22 [preprocessor]: react-jsx-ppx: optional argument annotations must have an explicit `option` type. Did you mean `option(bool)=?`? | ||
File "x.re", line 3, characters 15-27: | ||
3 | let make = (~myProp: bool=?) => React.null; | ||
^^^^^^^^^^^^ | ||
Error: This pattern matches values of type bool | ||
but a pattern was expected which matches values of type 'a option | ||
[1] |