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

Adding cases in different order breaks builder #1596

Open
mark-koch opened this issue Oct 18, 2024 · 0 comments · May be fixed by #1599
Open

Adding cases in different order breaks builder #1596

mark-koch opened this issue Oct 18, 2024 · 0 comments · May be fixed by #1599
Assignees
Labels
bug Something isn't working python Pull requests that update Python code

Comments

@mark-koch
Copy link
Contributor

This works,

cond = Conditional(tys.Either([tys.USize()], [tys.Unit]), [])
with cond.add_case(0) as case:
    case.set_outputs()
with cond.add_case(1) as case:
    case.set_outputs()

but this fails validation:

cond = Conditional(tys.Either([tys.USize()], [tys.Unit]), [])
with cond.add_case(1) as case:
    case.set_outputs()
with cond.add_case(0) as case:
    case.set_outputs()
@mark-koch mark-koch added bug Something isn't working python Pull requests that update Python code labels Oct 18, 2024
@ss2165 ss2165 self-assigned this Oct 18, 2024
ss2165 added a commit that referenced this issue Oct 18, 2024
Closes #1596

Was tempted to just change the type of `cases` since who would be using it anyway but I've tried to be good and deprecate instead
ss2165 added a commit that referenced this issue Oct 18, 2024
Closes #1596

Was tempted to just change the type of `cases` since who would be using it anyway but I've tried to be good and deprecate instead
ss2165 added a commit that referenced this issue Oct 18, 2024
Closes #1596

Was tempted to just change the type of `cases` since who would be using it anyway but I've tried to be good and deprecate instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants