terror_module.nim 984 B

123456789101112131415161718192021
  1. discard """
  2. joinable: false
  3. cmd: "nim check $file"
  4. errormsg: "type bound operation `=deepcopy` can be defined only in the same module with its type (MyTestObject)"
  5. nimout: '''
  6. terror_module.nim(14, 1) Error: type bound operation `=destroy` can be defined only in the same module with its type (MyTestObject)
  7. terror_module.nim(16, 1) Error: type bound operation `=sink` can be defined only in the same module with its type (MyTestObject)
  8. terror_module.nim(18, 1) Error: type bound operation `=` can be defined only in the same module with its type (MyTestObject)
  9. terror_module.nim(20, 1) Error: type bound operation `=deepcopy` can be defined only in the same module with its type (MyTestObject)
  10. '''
  11. """
  12. import helper
  13. proc `=destroy`[T](x: var MyTestObject[T]) = discard
  14. proc `=sink`[T](x: var MyTestObject[T], y:MyTestObject[T]) = discard
  15. proc `=`[T](x: var MyTestObject[T], y: MyTestObject[T]) = discard
  16. proc `=deepcopy`[T](x: ptr MyTestObject[T]): ptr MyTestObject[T] = discard