summary refs log blame commit diff stats
path: root/tests/misc/tstrange.nim
blob: fee0f44e43a188dbef8a015419f378ff2ea10ac7 (plain) (tree)
1
2
3
4
5
6

                      
                    

    
   
















                                



                    
 
discard """
  file: "tstrange.nim"
  output: '''hallo40
1
2'''
"""
# test for extremely strange bug

proc ack(x: int, y: int): int =
  if x != 0:
    if y != 5:
      return y
    return x
  return x+y

proc gen[T](a: T) =
  write(stdout, a)


gen("hallo")
write(stdout, ack(5, 4))
#OUT hallo4

# bug #1442
let h=3
for x in 0.. <h.int:
  echo x