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 message for constructor variables implicitly escaping into sizes #144

Open
ollef opened this issue Apr 26, 2019 · 0 comments
Open

Comments

@ollef
Copy link
Owner

ollef commented Apr 26, 2019

This currently crashes the compiler:

type Vect (n : Nat) t where
    Nil : forall t. Vect Zero t
    Cons : forall n t. t -> Vect n t -> Vect (Succ n) t

It's an illegal type (without boxed), because the compiler can't determine the size of the type from its parameters. This is the case because the size depends on variables (n and t) local to the constructors. It would work if we implemented #134, but there are other similar cases that still won't work.

We should add a proper error message for variables escaping from constructor types into the size calculation function instead of crashing.

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