Skip to content

Commit 607b098

Browse files
committed
Fix issue with duplication.
Fix #302
1 parent 63815a9 commit 607b098

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

analysis/src/ProcessCmt.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ struct
916916
| Texp_open (_, _path, _ident, _) -> Hashtbl.add extra.opens eloc ()
917917
| _ -> ());
918918
match expression.exp_desc with
919-
| Texp_ident (path, {txt; loc}, {val_type}) ->
920-
addForLongident (Some (val_type, Value)) path txt loc
919+
| Texp_ident (path, {txt; loc}, _) ->
920+
addForLongident (Some (expression.exp_type, Value)) path txt loc
921921
| Texp_record {fields} ->
922922
addForRecord expression.exp_type
923923
(fields |> Array.to_list

analysis/tests/src/Hover.res

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ let withAs = (~xx as yyy) => yyy + 1
9999

100100
module AA = {
101101
type cond<'a> = [< #str(string)] as 'a
102-
let fun = (b: cond<_>) => true ? b : b
102+
let fnnxx = (b: cond<_>) => true ? b : b
103103
}
104104

105-
let funAlias = AA.fun
105+
let funAlias = AA.fnnxx
106106

107107
let typeOk = funAlias
108108
// ^hov
109109

110-
let typeDuplicate = AA.fun
110+
let typeDuplicate = AA.fnnxx
111111
// ^hov

analysis/tests/src/expected/Fragment.res.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Hover tests/src/Fragment.res 6:19
2-
{"contents": "```rescript\n{\"children\": 'children} => 'children\n```"}
2+
{"contents": "```rescript\nReact.component<{\"children\": React.element}>\n```\n\n```rescript\ntype component<'props> = componentLike<'props, element>\n```"}
33

44
Hover tests/src/Fragment.res 9:56
55
null

analysis/tests/src/expected/Hover.res.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ Hover tests/src/Hover.res 75:7
4747
{"contents": "```rescript\nmodule A = {\n let x: int\n}\n```"}
4848

4949
Hover tests/src/Hover.res 85:10
50-
{"contents": "```rescript\n{\"children\": React.element} => React.element\n```"}
50+
{"contents": "```rescript\nReact.component<{\"children\": React.element}>\n```\n\n```rescript\ntype component<'props> = componentLike<'props, element>\n```"}
5151

5252
Hover tests/src/Hover.res 88:10
53-
{"contents": "```rescript\n{\"children\": React.element} => React.element\n```"}
53+
{"contents": "```rescript\nReact.component<{\"children\": React.element}>\n```\n\n```rescript\ntype component<'props> = componentLike<'props, element>\n```"}
5454

5555
Hover tests/src/Hover.res 93:25
5656
{"contents": "```rescript\nfloat\n```"}
@@ -62,5 +62,5 @@ Hover tests/src/Hover.res 106:16
6262
{"contents": "```rescript\nAA.cond<[< #str(string)]> => AA.cond<[< #str(string)]>\n```"}
6363

6464
Hover tests/src/Hover.res 109:25
65-
{"contents": "```rescript\nAA.cond<\n [< #str(string) & (string) & (string) & (string)],\n> => AA.cond<\n [< #str(string) & (string) & (string) & (string)],\n>\n```"}
65+
{"contents": "```rescript\nAA.cond<[< #str(string)]> => AA.cond<[< #str(string)]>\n```"}
6666

0 commit comments

Comments
 (0)