tchk2.nim 690 B

123456789101112131415161718192021222324252627282930313233343536
  1. # bug #22794
  2. type O = object
  3. proc `=destroy`(x: O) = discard
  4. proc `=trace`(x: var O; env: pointer) = discard
  5. proc `=copy`(a: var O; b: O) = discard
  6. proc `=dup`(a: O): O {.nodestroy.} = a
  7. proc `=sink`(a: var O; b: O) = discard
  8. # bug #23316
  9. type SomeSturct = object
  10. proc `=destroy`(x: SomeSturct) =
  11. echo "SomeSturct destroyed"
  12. # bug #23867
  13. type ObjStr = object
  14. s: string
  15. let ostr = ObjStr() # <-- nimsuggest crashes
  16. discard ostr
  17. type ObjSeq = object
  18. s: seq[int]
  19. let oseq = ObjSeq() # <-- nimsuggest crashes
  20. discard oseq
  21. #[!]#
  22. discard """
  23. $nimsuggest --tester $file
  24. >chk $1
  25. chk;;skUnknown;;;;Hint;;???;;0;;-1;;">> (toplevel): import(dirty): tests/tchk2.nim [Processing]";;0
  26. """