Skip to content

Commit 2bd9366

Browse files
committed
clean up
1 parent 4ec6771 commit 2bd9366

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

jscomp/ml/typemod.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,12 +1855,11 @@ let report_error ppf = function
18551855
types (other than when replacing a type constructor with @ \
18561856
a type constructor with the same arguments).@]"
18571857
| Repeated_name(kind, name, repeated_loc) ->
1858-
let start_line = repeated_loc.loc_start.pos_lnum in
1859-
let start_col = repeated_loc.loc_start.pos_cnum - repeated_loc.loc_start.pos_bol in
1860-
let end_col = repeated_loc.loc_end.pos_cnum - repeated_loc.loc_end.pos_bol in
1858+
let (_, start_line, start_char) = Location.get_pos_info repeated_loc.loc_start in
1859+
let (_, _, end_char) = Location.get_pos_info repeated_loc.loc_end in
18611860
fprintf ppf
18621861
"@[Multiple definition of the %s name %s at line %d, characters %d-%d.@ \
1863-
Names must be unique in a given structure or signature.@]" kind name start_line start_col end_col
1862+
Names must be unique in a given structure or signature.@]" kind name start_line start_char end_char
18641863
| Non_generalizable typ ->
18651864
fprintf ppf
18661865
"@[The type of this expression,@ %a,@ \

0 commit comments

Comments
 (0)