Skip to content

Commit b508aac

Browse files
committed
Add example of poly variant duplication.
See #302
1 parent 1846062 commit b508aac

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

analysis/tests/src/Hover.res

+12
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,15 @@ let _get = r => r.f +. r.i
9696

9797
let withAs = (~xx as yyy) => yyy + 1
9898
// ^hov
99+
100+
module AA = {
101+
type cond<'a> = [< #str(string)] as 'a
102+
type t<'a> = {b: cond<'a>}
103+
let fun = b => {b: b}
104+
}
105+
106+
let typeOk = AA.fun
107+
// ^hov
108+
109+
let typeDuplicate = AA.fun
110+
// ^hov

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

+6
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,9 @@ Hover tests/src/Hover.res 93:25
5858
Hover tests/src/Hover.res 96:21
5959
{"contents": "```rescript\nint\n```"}
6060

61+
Hover tests/src/Hover.res 105:6
62+
{"contents": "```rescript\nAA.cond<[< #str(string)]> => AA.t<[< #str(string)]>\n```"}
63+
64+
Hover tests/src/Hover.res 108:24
65+
{"contents": "```rescript\nAA.cond<\n [< #str(string) & (string) & (string)],\n> => AA.t<[< #str(string) & (string) & (string)]>\n```"}
66+

0 commit comments

Comments
 (0)