tmissingderef2.nim 352 B

1234567891011121314151617181920212223242526
  1. discard """
  2. output: "c"
  3. """
  4. # bug #5079
  5. import tables
  6. type Test = ref object
  7. s: string
  8. proc `test=`(t: Test, s: string) =
  9. t.s = s
  10. var t = Test()
  11. #t.test = spaces(2) # -- works
  12. var a = newTable[string, string]()
  13. a["b"] = "c"
  14. #t.s = a["b"] # -- works
  15. #t.test a["b"] # -- works
  16. t.test = a["b"] # -- prints "out of memory" and quits
  17. echo t.s