tcasts.nim 405 B

123456789101112131415161718192021
  1. discard """
  2. cmd: "nim cpp $file"
  3. output: '''{"vas": "kas", "123": "123"}'''
  4. targets: "cpp"
  5. """
  6. block: #5979
  7. var a = 'a'
  8. var p: pointer = cast[pointer](a)
  9. var c = cast[char](p)
  10. doAssert(c == 'a')
  11. #----------------------------------------------------
  12. # bug #9739
  13. import tables
  14. var t = initTable[string, string]()
  15. discard t.hasKeyOrPut("123", "123")
  16. discard t.mgetOrPut("vas", "kas")
  17. echo t