diff --git a/jscomp/others/js_json.res b/jscomp/others/js_json.res index d2908287d5..925219737b 100644 --- a/jscomp/others/js_json.res +++ b/jscomp/others/js_json.res @@ -35,13 +35,13 @@ type rec t = | Array(array) module Kind = { - type rec kind<_> = - | String: kind - | Number: kind - | Object: kind> - | Array: kind> - | Boolean: kind - | Null: kind + type rec s<_> = + | String: s + | Number: s + | Object: s> + | Array: s> + | Boolean: s + | Null: s } type tagged_t = @@ -74,7 +74,7 @@ let classify = (x: t): tagged_t => { } } -let test = (type a, x: 'a, v: Kind.kind): bool => +let test = (type a, x: 'a, v: Kind.s): bool => switch v { | Kind.Number => Js.typeof(x) == "number" | Kind.Boolean => Js.typeof(x) == "boolean" diff --git a/jscomp/others/js_json.resi b/jscomp/others/js_json.resi index e8194eb543..7245fd9edc 100644 --- a/jscomp/others/js_json.resi +++ b/jscomp/others/js_json.resi @@ -42,13 +42,13 @@ type rec t = module Kind: { /** Underlying type of a JSON value */ - type rec kind<_> = - | String: kind - | Number: kind - | Object: kind> - | Array: kind> - | Boolean: kind - | Null: kind + type rec s<_> = + | String: s + | Number: s + | Object: s> + | Array: s> + | Boolean: s + | Null: s } type tagged_t = @@ -65,7 +65,7 @@ type tagged_t = let classify: t => tagged_t /** `test(v, kind)` returns `true` if `v` is of `kind`. */ -let test: ('a, Kind.kind<'b>) => bool +let test: ('a, Kind.s<'b>) => bool /** `decodeString(json)` returns `Some(s)` if `json` is a `string`, `None` otherwise. */ let decodeString: t => option diff --git a/jscomp/test/js_json_test.res b/jscomp/test/js_json_test.res index 0892ba8f36..8587771de2 100644 --- a/jscomp/test/js_json_test.res +++ b/jscomp/test/js_json_test.res @@ -145,7 +145,7 @@ let () = { /* Check that the given json value is an array and that its element * a position [i] is equal to both the [kind] and [expected] value */ -let eq_at_i = (type a, loc: string, json: J.t, i: int, kind: J.Kind.kind, expected: a): unit => { +let eq_at_i = (type a, loc: string, json: J.t, i: int, kind: J.Kind.s, expected: a): unit => { let ty = J.classify(json) switch ty { | J.JSONArray(x) =>