We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using rescript format on the following code yields syntactically incorrect result:
rescript format
// compiles successfully module type T = { let f: string => string } let g = (x: string) => { module M: T = { let f = s => s ++ s } x->M.f }
will be formatted to:
// compilation fails with syntax error module type T = { let f: string => string } let g = (x: string) => { module M = { let f = s => s ++ s }: T // <-- Note the type annotation was moved here~ x->M.f }
Afaik this issue is present in all versions of rescript (9.* & 10.*).
Repro available as a repository at https://github.com/woeps/rescript-formatting-issue-repro or at the playground..
While I understand this is not ideal code in most cases, I believe formatting should always yield a syntactically correct result.
Note: If the module (with type signature) is not inside a function, formatting works as expected:
// compiles successfully and won't be reformatted module type T = { let f: string => string } module M: T = { let f = s => s ++ s }
above example at the Playground
The text was updated successfully, but these errors were encountered:
Definitely a bug, likely with the pretty printer.
Sorry, something went wrong.
Fix printing of local module with type.
737f0af
Fixes #6212
77334f7
Successfully merging a pull request may close this issue.
Using
rescript format
on the following code yields syntactically incorrect result:will be formatted to:
Afaik this issue is present in all versions of rescript (9.* & 10.*).
Repro available as a repository at https://github.com/woeps/rescript-formatting-issue-repro or at the playground..
While I understand this is not ideal code in most cases, I believe formatting should always yield a syntactically correct result.
Note: If the module (with type signature) is not inside a function, formatting works as expected:
above example at the Playground
The text was updated successfully, but these errors were encountered: