Issue4755b.agda 696 B

12345678910111213141516171819202122232425262728
  1. {-# OPTIONS --rewriting #-}
  2. open import Agda.Builtin.Unit
  3. open import Agda.Builtin.Equality
  4. open import Agda.Builtin.Equality.Rewrite
  5. data Box : Set → Set₁ where
  6. box : (A : Set) → Box A
  7. data D (A : Set) : Set₁ where
  8. c : A → Box A → D A
  9. postulate
  10. any : {A : Set} → A
  11. one : {A : Set} → D A
  12. rew : ∀ A → c any (box A) ≡ one
  13. -- Jesper, 2020-06-17: Ideally Agda should reject the above rewrite
  14. -- rule, since it causes reduction to be unstable under eta-conversion
  15. works : c any (box ⊤) ≡ c tt (box ⊤)
  16. works = refl
  17. -- However, currently it is accepted, breaking subject reduction:
  18. {-# REWRITE rew #-}
  19. fails : c any (box ⊤) ≡ c tt (box ⊤)
  20. fails = refl