ttypeof.nim 392 B

123456789101112131415161718192021222324252627
  1. discard """
  2. output: '''12
  3. int
  4. int
  5. int'''
  6. """
  7. import typetraits
  8. # bug #1805
  9. proc foob(x: int): string = "foo"
  10. proc barb(x: string): int = 12
  11. echo(foob(10).barb()) # works
  12. echo(type(10).name()) # doesn't work
  13. echo(name(type(10))) # works
  14. echo((type(10)).name()) # works
  15. # test that 'addr' still works
  16. proc poo(x, y: ptr int) = discard
  17. var someInt: int
  18. poo(addr someInt, addr someInt)