summary refs log blame commit diff stats
path: root/tests/destructor/tinvalid_rebind.nim
blob: 0f15c8f9e7782c58ebb6a47aeda5e2d6fccdf3f5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                                                                    
discard """
joinable: false
cmd: "nim check $file"
errormsg: "cannot bind another '=destroy' to: Foo; previous declaration was constructed here implicitly: tinvalid_rebind.nim(12, 7)"
line: 14
"""

type
  Foo[T] = object

proc main =
  var f: Foo[int]

proc `=destroy`[T](f: var Foo[T]) =
  discard