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

Equation solver behavior inconsistency #268

Open
ice1000 opened this issue Sep 30, 2020 · 2 comments
Open

Equation solver behavior inconsistency #268

ice1000 opened this issue Sep 30, 2020 · 2 comments
Assignees
Labels

Comments

@ice1000
Copy link
Contributor

ice1000 commented Sep 30, 2020

This code checks:

\func M : \Pi (x : S1) -> \Type => \lam x => \case x \with {
   | base => I
   | loop i => twist @ i
}

But this doesn't:

\func M (x : S1) : \Type
   | base => I
   | loop i => twist @ i

Error:

Cannot solve equations   \lh = \oo
@ice1000 ice1000 added the level label Sep 30, 2020
@valis
Copy link
Collaborator

valis commented Oct 1, 2020

This is an expected behavior because the type of a function defined by pattern matching is checked before the body, but the type of the first version is checked together with the body.

@valis valis closed this as completed Oct 1, 2020
@valis
Copy link
Collaborator

valis commented Oct 1, 2020

Actually, we can defer the inference of levels for the type in the second version.

@valis valis reopened this Oct 1, 2020
@valis valis self-assigned this Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants