Skip to content

Commit e942812

Browse files
committed
tweaks
1 parent ce44277 commit e942812

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

analysis/src/ProcessExtra.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ let expr ~env ~(extra : extra) (iter : Tast_iterator.iterator)
397397
|> Utils.filterMap (fun (desc, item, opt) ->
398398
match item with
399399
| Typedtree.Overridden (loc, _) -> Some (loc, desc, (), opt)
400-
| _ -> None))
400+
| _ -> None));
401+
addLocItem extra expression.exp_loc (OtherExpression expression.exp_type)
401402
| Texp_constant constant ->
402403
addLocItem extra expression.exp_loc (Constant constant)
403404
(* Skip unit and list literals *)

analysis/src/TypeUtils.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ let rec hasTvar (ty : Types.type_expr) : bool =
3737

3838
let findTypeViaLoc ~full ~debug (loc : Location.t) =
3939
match References.getLocItem ~full ~pos:(Pos.ofLexing loc.loc_end) ~debug with
40-
| Some {locType = Typed (_, typExpr, _)} -> Some typExpr
40+
| Some
41+
{
42+
locType =
43+
Typed (_, typExpr, _) | OtherExpression typExpr | OtherPattern typExpr;
44+
} ->
45+
Some typExpr
4146
| _ -> None
4247

4348
let pathFromTypeExpr (t : Types.type_expr) =

0 commit comments

Comments
 (0)