Erasure-Issue2640.agda 487 B

12345678910111213141516171819202122
  1. -- Andreas, 2018-10-18, re #2757
  2. -- Runtime-irrelevance analogue to issue #2640
  3. -- {-# OPTIONS -v tc.lhs.unify:65 #-}
  4. -- {-# OPTIONS -v tc.irr:20 #-}
  5. -- {-# OPTIONS -v tc:30 #-}
  6. -- {-# OPTIONS -v treeless:20 #-}
  7. open import Common.Prelude
  8. data D : (n : Nat) → Set where
  9. c : (m : Nat) → D m
  10. test : (@0 n : Nat) → D n → Nat
  11. test n (c m) = m
  12. -- Should be rejected (projecting a forced argument).
  13. main = printNat (test 142 (c _))
  14. -- The generated Haskell program segfaults.