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

Uppercase type arguments don't work in inlined records #6759

Closed
DZakh opened this issue May 22, 2024 · 1 comment · Fixed by #6820
Closed

Uppercase type arguments don't work in inlined records #6759

DZakh opened this issue May 22, 2024 · 1 comment · Fixed by #6820

Comments

@DZakh
Copy link
Contributor

DZakh commented May 22, 2024

type_id_6<'T, 'E> = | Ok('T) | Err({payload: 'E})

It works for 'T, but not for 'E

Errors:

Did you mean `e` instead of `E`?
The type variable name '_ is not allowed in programs
@cristianoc
Copy link
Collaborator

Likely enough to do:

diff --git a/jscomp/syntax/src/res_core.ml b/jscomp/syntax/src/res_core.ml
index 48023f378..6f1d4c688 100644
--- a/jscomp/syntax/src/res_core.ml
+++ b/jscomp/syntax/src/res_core.ml
@@ -4056,7 +4056,9 @@ and parse_type_var_list p =
     match p.Parser.token with
     | SingleQuote ->
       Parser.next p;
-      let lident, loc = parse_lident p in
+      let lident, loc =
+        parse_ident ~msg:ErrorMessages.type_param ~start_pos:p.start_pos p
+      in

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.

2 participants