Doesn't handle keyof and typeof #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
gettypes emits
keyofandtypeofwith singletypeArgs. Unless we want to add a generic type operator thing we need to hardcode them in the templates.I think the type param kludge is preferable to a separate property, since it is harder to accidentally 'drop' the operator by ignoring the property for it this way (i.e. in its current form, builddocs' output will at least convey the information that the operator is there, even if it should format it more TypeScript-like). But yeah, we should add a special case to the type template for these.
A generic thing could look like
{type: "operation", operator: "typeof", typeArgs: ["X"]}. I'm still wondering if putting both user-defined types and syntax types intypeis a good thing to do …It seemed like a convenient encoding for the above reasons, and because
typeOrigin=nullcan be used to unambiguously distinguish these from user-defined types with the same names. But yeah, what you describe would use the fields in a somewhat more structured way, and if you want to move to that I'm fine with it too (I assume union/intersection would also follow that form?).I tried it out, but it doesn't actually help, since the output for most operations (except single keyword operations) is specific.
Fixed in #15.