InlineRecursive.agda 266 B

123456789101112131415
  1. {-# OPTIONS -v treeless.opt:20 #-}
  2. -- Test that inlining a recursive function doesn't throw
  3. -- the compiler into a loop.
  4. module _ where
  5. open import Common.Prelude
  6. f : Nat → Nat
  7. f zero = zero
  8. f (suc n) = f n
  9. {-# INLINE f #-}
  10. main : IO Unit
  11. main = printNat (f 4)