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

Casting should be implicit in case statements #720

Open
brynrhodes opened this issue Feb 1, 2022 · 0 comments
Open

Casting should be implicit in case statements #720

brynrhodes opened this issue Feb 1, 2022 · 0 comments

Comments

@brynrhodes
Copy link
Member

Ideally, the translator should detect and support discriminated unions:

define function "Implied cast"(vaccination Choice<Immunization,Procedure>):
  case 
    when vaccination is Immunization then vaccination.code
    when vaccination is Procedure then vaccination.code
    else null
  end

In this example, effectively treating the references to vaccination within the then clauses of each case item as though they were of the is type for the item.

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

No branches or pull requests

1 participant