Skip to content

Commit

Permalink
[display] fix range of pattern variables
Browse files Browse the repository at this point in the history
Note: not including texprConverter changes

see 160a490
see #7282
  • Loading branch information
Simn authored and kLabz committed Jul 3, 2024
1 parent 7a72358 commit 9f8c659
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/context/display/diagnostics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ let find_unused_variables com e =
let vars = Hashtbl.create 0 in
let pmin_map = Hashtbl.create 0 in
let rec loop e = match e.eexpr with
| TVar({v_kind = VUser _} as v,eo) when v.v_name <> "_" && not (has_var_flag v VUsedByTyper) ->
| TVar({v_kind = VUser origin} as v,eo) when v.v_name <> "_" && not (has_var_flag v VUsedByTyper) ->
Hashtbl.add pmin_map e.epos.pmin v;
let p = match eo with
| None -> e.epos
| Some e1 ->
loop e1;
{ e.epos with pmax = e1.epos.pmin }
| Some e1 when origin <> TVOPatternVariable ->
loop e1;
{ e.epos with pmax = e1.epos.pmin }
| _ ->
e.epos
in
Hashtbl.replace vars v.v_id (v,p);
| TLocal ({v_kind = VUser _} as v) ->
Expand Down

0 comments on commit 9f8c659

Please sign in to comment.