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

ppxlib#trunk-support on 5.1.0~alpha1 breaks let f: type a. syntax #418

Closed
copy opened this issue Apr 16, 2023 · 4 comments
Closed

ppxlib#trunk-support on 5.1.0~alpha1 breaks let f: type a. syntax #418

copy opened this issue Apr 16, 2023 · 4 comments

Comments

@copy
Copy link

copy commented Apr 16, 2023

Consider:

let f: type a. a option -> _ = assert false
(executable
 (name test)
 (flags :standard -dsource)
 (preprocess (pps ppx_here)))

On OCaml 5.1.0~alpha1 it results in the following error:

File "dune", line 1, characters 0-82:  
1 | (executable
2 |  (name test)
3 |  (flags :standard -dsource)
4 |  (preprocess (pps ppx_here)))
[@@@ocaml.ppx.context
  {
    tool_name = "ppx_driver";
    include_dirs = [];
    load_path = [];
    open_modules = [];
    for_package = None;
    debug = false;
    use_threads = false;
    use_vmthreads = false;
    recursive_types = false;
    principal = false;
    transparent_modules = false;
    unboxed_types = false;
    unsafe_string = false;
    cookies = []
  }]
let (f : 'a . a option -> _) = fun (type a) -> (assert false : a option -> _)
File "test.ml", line 1, characters 15-16:
1 | let f: type a. a option -> _ = assert false
                   ^
Error: Unbound type constructor a

While on 5.0:

let f : type a. a option -> _ = assert false

(any ppx that uses ppxlib demonstrates this issue, ppx_here is just a small example)

@copy
Copy link
Author

copy commented Apr 16, 2023

Here's a simpler one:

File "test.ml", line 1, characters 4-10:
1 | let (x, y) : (int * int) = assert false
        ^^^^^^
Error: This pattern matches values of type 'a * 'b
       but a pattern was expected which matches values of type int * int

@panglesd
Copy link
Collaborator

Thanks for the report. This is related to the parsetree migration (see #407). I'll have a look.

@panglesd
Copy link
Collaborator

Should be fixed by #420.

@pitag-ha
Copy link
Member

Thanks again for reporting, @copy! It's fixed now.

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 a pull request may close this issue.

3 participants