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

Error out when attempting to generate a default for a disjunction with multiple defaults #15

Open
sdboyer opened this issue Aug 17, 2021 · 1 comment
Assignees
Labels

Comments

@sdboyer
Copy link
Contributor

sdboyer commented Aug 17, 2021

CUE itself falls back to bottom when there's a disjunction with multiple defaults on it. cuetsy should preserve these semantics, erroring out when it is requested that it generate a default const for an object that contains multiple default values.

@sdboyer sdboyer added kind/feature New feature or request component/generator labels Aug 17, 2021
@ying-jeanne ying-jeanne reopened this Aug 26, 2021
@ying-jeanne ying-jeanne added this to the 8.2.0 milestone Aug 30, 2021
@ying-jeanne ying-jeanne added this to To do in Grafana Backend (DO NOT USE!) via automation Aug 30, 2021
@ying-jeanne ying-jeanne self-assigned this Aug 30, 2021
@ying-jeanne
Copy link
Collaborator

the current behaviour when testing:

-- cue --
E3: "a" | *"b" | *"c" @cuetsy(kind="enum")

-- err --
export enum E3 {
  A = 'a',
  B = 'b',
  C = 'c',
}
export const e3Default: E3 = E3.B' | 'C

@ying-jeanne ying-jeanne moved this from To do to Under review in Grafana Backend (DO NOT USE!) Aug 31, 2021
@ying-jeanne ying-jeanne linked a pull request Aug 31, 2021 that will close this issue
@ying-jeanne ying-jeanne removed this from the 8.2.0 milestone Sep 9, 2021
@ying-jeanne ying-jeanne removed this from Under review in Grafana Backend (DO NOT USE!) Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants