Hey folks, I’ve got a recursive type definition that looks like
// Inside module "Node"
@genType
type rec t = {
kind: kind,
props: props,
children: array<t>,
}
@genType
and kind =
| Primitive(string)
| Composite(compositeFactory)
@genType
and compositeFactory = (renderContext, props, array<t>) => t
and my Typescript output is the following:
export type Node_t = {
readonly kind: kind;
readonly props: Node_props;
readonly children: Node_t[];
};
// tslint:disable-next-line:interface-over-type-literal
export type Node_kind =
{ tag: "Primitive"; value: string }
| { tag: "Composite"; value: compositeFactory };
// tslint:disable-next-line:interface-over-type-literal
export type Node_compositeFactory = (_1:Node_renderContext, _2:Node_props, _3:Node_t[]) => Node_t;
The generated typedefs are almost perfect here, but notice that the generated type Node_t
has a property kind
of type kind
but there is no generated type kind
, it’s called Node_kind
(and same thing with compositeFactory
). Am I doing something wrong here? Or is this perhaps a genType bug?