Erased-constructors.agda 443 B

12345678910111213141516171819
  1. -- Test case for issue #4638.
  2. -- Partly based on code due to Andrea Vezzosi.
  3. open import Common.Prelude
  4. data D : Set where
  5. run-time : Bool → D
  6. @0 compile-time : Bool → D
  7. f : D → @0 D → Bool
  8. f (run-time x) _ = x
  9. f (compile-time x) (run-time y) = x
  10. f (compile-time x) (compile-time y) = y
  11. main : IO Unit
  12. main =
  13. putStrLn (if f (run-time true) (compile-time false)
  14. then "ok" else "bad")