Skip to content

Commit 62e5c5c

Browse files
committed
Failing test for generating interface where a module has multiple type constraints
1 parent 9ce1432 commit 62e5c5c

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

tests/analysis_tests/tests/src/CreateInterface.res

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,24 @@ module ComponentWithPolyProp = {
171171
<div className />
172172
}
173173
}
174+
175+
module OrderedSet = {
176+
type t<'a, 'identity> = {
177+
cmp: ('a, 'a) => int,
178+
set: Belt.Set.t<'a, 'identity>,
179+
array: array<'a>,
180+
}
181+
182+
let make = (
183+
type value identity,
184+
~id: module(Belt.Id.Comparable with type t = value and type identity = identity),
185+
): t<value, identity> => {
186+
let module(M) = id
187+
188+
{
189+
cmp: M.cmp->Belt.Id.getCmpInternal,
190+
set: Belt.Set.make(~id),
191+
array: [],
192+
}
193+
}
194+
}

tests/analysis_tests/tests/src/expected/CreateInterface.res.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,12 @@ module ComponentWithPolyProp: {
124124
@react.component
125125
let make: (~size: [< #large | #small]=?) => Jsx.element
126126
}
127+
module OrderedSet: {
128+
type t<'a, 'identity> = {
129+
cmp: ('a, 'a) => int,
130+
set: Belt.Set.t<'a, 'identity>,
131+
array: array<'a>,
132+
}
133+
let make: (~id: module(Belt.Id.Comparable with type identity = 'a with type t = 'b)) => t<'b, 'a>
134+
}
127135

0 commit comments

Comments
 (0)