Arend icon indicating copy to clipboard operation
Arend copied to clipboard

Equation solver behavior inconsistency

Open ice1000 opened this issue 4 years ago • 2 comments

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 avatar Sep 30 '20 03:09 ice1000

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 avatar Oct 01 '20 10:10 valis

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

valis avatar Oct 01 '20 10:10 valis