tcasts.nim 374 B

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