Skip to content

fix location of variable when function definition {v => ...} is enc… #5949

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

Merged
merged 1 commit into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ These are only breaking changes for unformatted code.
- Fix issue where the internal representation of uncurried types would leak when a non-function is applied in a curried way https://github.com/rescript-lang/rescript-compiler/pull/5892
- In GenType, check annotations also in module types to decide whether to produce the `.gen.tsx` file https://github.com/rescript-lang/rescript-compiler/pull/5903
- Fix some comments disappearing in array access expressions https://github.com/rescript-lang/rescript-compiler/pull/5947
- Parser: fix location of variable when function definition `{v => ...}` is enclosed in braces https://github.com/rescript-lang/rescript-compiler/pull/5949

#### :nail_care: Polish

Expand Down
2 changes: 1 addition & 1 deletion res_syntax/src/res_core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2933,7 +2933,7 @@ and parseBracedOrRecordExpr p =
attrs = [];
label = Asttypes.Nolabel;
expr = None;
pat = Ast_helper.Pat.var ident;
pat = Ast_helper.Pat.var ~loc:ident.loc ident;
pos = startPos;
};
]
Expand Down