Skip to content

Commit 8b40ba0

Browse files
committed
make sure coercion is disallowed for dicts
1 parent 76bd849 commit 8b40ba0

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/dict_coercion.res:7:10-30
4+
5+
5 │ type fakeDict<'t> = {anyOtherField?: 't}
6+
6 │
7+
7 │ let d = (dict :> fakeDict<int>)
8+
8 │
9+
10+
Type Js.Dict.t<int> = dict<int> is not a subtype of fakeDict<int>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
let dict = Js.Dict.empty()
2+
dict->Js.Dict.set("someKey1", 1)
3+
dict->Js.Dict.set("someKey2", 2)
4+
5+
type fakeDict<'t> = {anyOtherField?: 't}
6+
7+
let d = (dict :> fakeDict<int>)

0 commit comments

Comments
 (0)