Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate disjunctions in parentheses #55

Closed
sdboyer opened this issue Jun 1, 2022 · 0 comments · Fixed by #56
Closed

Generate disjunctions in parentheses #55

sdboyer opened this issue Jun 1, 2022 · 0 comments · Fixed by #56
Assignees

Comments

@sdboyer
Copy link
Contributor

sdboyer commented Jun 1, 2022

Currently, the following input:

U1: "foo" | "bar" | "baz" @cuetsy(kind="type")
U2: 1 | 2 | 3 @cuetsy(kind="type")
U3: {
    listU: [...(dep.U1 | U2 | U1)]
} @cuetsy(kind="interface")

will produce the following output (modulo my comment):

export type U1 = 'foo' | 'bar' | 'baz';

export type U2 = 1 | 2 | 3;

export interface U3 {
  listU: dep.U1 | U2 | U1[]; // straight up inccorrect - needs parens
}

I think the simplest solution here is just to always generate parentheses on output. It's not the tidiest, but as long as the output is correct, i think that's sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant