[ "type Thing union {int=0|int|str=0}" parse-schema ] [ duplicate-keys? ] must-fail-with
[ "type Thing union {int=0|uint|str=0}" parse-schema ] [ duplicate-values? ] must-fail-with
+
+! struct checks
+
+[ "type Thing struct { a: int b: int a: int }" parse-schema ] [ duplicate-keys? ] must-fail-with
struct-field = struct-field-name ws ":"~ ws any-type => [[ >array ]]
struct-fields = struct-field (ws struct-field)* => [[ first2 swap prefix ]]
struct = "struct"~ ws "{"~ ws~ struct-fields ws "}"~
- => [[ struct boa ]]
+ => [[ check-duplicate-keys struct boa ]]
union-members = union-member (ws "|"~ ws union-member)* => [[ first2 swap prefix ]]
union-member = any-type (ws "="~ ws number)? => [[ >array ]]