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

Unifier throws away pattern #2896

UlfNorell opened this Issue Jan 12, 2018 · 0 comments



UlfNorell commented Jan 12, 2018

data Nat : Set where
  zero : Nat
  suc  : Nat  Nat

data I : Set where
  _,_ : Nat  Nat  I

data D : I → Set where
  d :  i  D i

foo :  x y  D (x , y)  Nat
foo _ _ (d (suc m , suc n)) = n  -- panic: unbound variable n
foo x y _ = zero

The unifier throws away the suc patterns and returns foo x y d .(x, y). This is fixed by the lhs refactoring in #2866.

If you don't use n in the right-hand side you get an "unreachable clause" error on the second clause instead.

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