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

case-of and subtyping #378

Closed
zilinc opened this issue Jul 29, 2020 · 0 comments
Closed

case-of and subtyping #378

zilinc opened this issue Jul 29, 2020 · 0 comments

Comments

@zilinc
Copy link

zilinc commented Jul 29, 2020

type V = <A U8 | B Bool>

foo : V -> ()
foo v = v | A x -> v | A x -> ()
                     | B x -> ()
          | v' -> v' | A x -> ()
                     | B x -> ()

This program passes surface, but crashes core typechecker.

In general, every time we match a tag in a variant, we can (by promotion) turn the taken alternative to an untaken one, and perform the same match again (assuming the scrutinee is not linear).

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