Closed
Description
Using rescript@11.0.0-rc.3
and @rescript/core@0.4.0
with bsconfig.json
{
"name": "playground",
"sources": {
"dir": "src",
"subdirs": true
},
"package-specs": {
"module": "commonjs",
"in-source": true
},
"suffix": ".bs.js",
"bsc-flags": ["-open RescriptCore"],
"bs-dependencies": ["@rescript/core"]
}
Below works
@unboxed
type rec json =
| @as(false) False
| @as(true) True
| @as(null) Null
| String(string)
| Number(float)
| Object(Js.Dict.t<json>)
| Array(array<json>)
But below doesn't work
@unboxed
type rec json =
| @as(false) False
| @as(true) True
| @as(null) Null
| String(string)
| Number(float)
| Object(Dict.t<json>) // <--- here
| Array(array<json>)
The compiler gives error
This untagged variant definition is invalid: Case Object has a payload that is not of one of the recognized shapes (object, array, etc). Then it must be the only case with payloads.
Metadata
Metadata
Assignees
Labels
No labels