Skip to content

Clean up Super_error #6199

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 11 commits into from
Apr 27, 2023
Merged
Changes from 1 commit
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
7 changes: 3 additions & 4 deletions jscomp/ml/typemod.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1855,12 +1855,11 @@ let report_error ppf = function
types (other than when replacing a type constructor with @ \
a type constructor with the same arguments).@]"
| Repeated_name(kind, name, repeated_loc) ->
let start_line = repeated_loc.loc_start.pos_lnum in
let start_col = repeated_loc.loc_start.pos_cnum - repeated_loc.loc_start.pos_bol in
let end_col = repeated_loc.loc_end.pos_cnum - repeated_loc.loc_end.pos_bol in
let (_, start_line, start_char) = Location.get_pos_info repeated_loc.loc_start in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you check that these correspond to the locations printed normally (whether starting from 0 or 1) for other error messages?

let (_, _, end_char) = Location.get_pos_info repeated_loc.loc_end in
fprintf ppf
"@[Multiple definition of the %s name %s at line %d, characters %d-%d.@ \
Names must be unique in a given structure or signature.@]" kind name start_line start_col end_col
Names must be unique in a given structure or signature.@]" kind name start_line start_char end_char
| Non_generalizable typ ->
fprintf ppf
"@[The type of this expression,@ %a,@ \
Expand Down