tinvalid_rebind_nonempty.nim 275 B

1234567891011121314151617
  1. discard """
  2. joinable: false
  3. cmd: "nim check $file"
  4. errormsg: "cannot bind another '=destroy' to: Foo; previous declaration was constructed implicitly"
  5. line: 15
  6. """
  7. type
  8. Foo[T] = object
  9. x: T
  10. proc main =
  11. var f: Foo[int]
  12. proc `=destroy`[T](f: var Foo[T]) =
  13. discard