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

parsexp doesn't work on 4.13 #18934

Closed
wants to merge 1 commit into from
Closed

parsexp doesn't work on 4.13 #18934

wants to merge 1 commit into from

Conversation

samoht
Copy link
Member

@samoht samoht commented Jun 25, 2021

It fails with:

 File "src/parser_automaton_internal.ml", lines 440-454, characters 6-66:
 440 | ......match state.kind with
 441 |       | Positions ->
 442 |         (* Note we store end positions as inclusive in [Positions.t], so we use [delta:0],
 443 |            while in the [Cst] case we save directly the final ranges, so we use
 444 |            [delta:1]. *)
 ...
 451 |           add_pos state ~delta:0;
 452 |           make_list [] stack)
 453 |         else stack
 454 |       | Cst -> make_list_cst (current_pos state ~delta:1) [] stack
 Warning 18 [not-principal]:
   The return type of this pattern-matching is ambiguous.
   Please add a type annotation, as the choice of `s' is not principal.
 File "src/parser_automaton_internal.ml", line 485, characters 44-66:
 485 |     | Sexp -> if is_not_ignoring state then Sexp (Atom str, stack) else stack
                                                   ^^^^^^^^^^^^^^^^^^^^^^
 Error: The constructor Sexp expects 0 argument(s),
        but is applied here to 1 argument(s)

It fails with:

```
 File "src/parser_automaton_internal.ml", lines 440-454, characters 6-66:
 440 | ......match state.kind with
 441 |       | Positions ->
 442 |         (* Note we store end positions as inclusive in [Positions.t], so we use [delta:0],
 443 |            while in the [Cst] case we save directly the final ranges, so we use
 444 |            [delta:1]. *)
 ...
 451 |           add_pos state ~delta:0;
 452 |           make_list [] stack)
 453 |         else stack
 454 |       | Cst -> make_list_cst (current_pos state ~delta:1) [] stack
 Warning 18 [not-principal]:
   The return type of this pattern-matching is ambiguous.
   Please add a type annotation, as the choice of `s' is not principal.
 File "src/parser_automaton_internal.ml", line 485, characters 44-66:
 485 |     | Sexp -> if is_not_ignoring state then Sexp (Atom str, stack) else stack
                                                   ^^^^^^^^^^^^^^^^^^^^^^
 Error: The constructor Sexp expects 0 argument(s),
        but is applied here to 1 argument(s)
```
@kit-ty-kate
Copy link
Member

It's a bug in OCaml. It will be fixed in ocaml/ocaml#10364 no need to add a bound here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants