ModuleArgs.agda 492 B

12345678910111213141516171819202122232425262728
  1. -- Andreas, 2021-06-01, also test issue #5425
  2. module ModuleArgs where
  3. open import Common.Nat
  4. open import Common.IO
  5. open import Common.Unit
  6. module X (y : Nat) where
  7. addTo : Nat → Nat
  8. addTo x = y + x
  9. data D : Set where
  10. c : D
  11. open X 23
  12. -- This used to crash `agda --js --js-optimize`
  13. -- which could not cope with constructors from applied modules
  14. -- (missing canonicalization of constructor names).
  15. c' : D
  16. c' = c
  17. -- should return 35
  18. main : IO Unit
  19. main = printNat (addTo 12)