summary refs log blame commit diff stats
path: root/tests/template/t11705.nim
blob: 65ddc7e6c5ac048c871fa45f9cd757a3fc7e31ad (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                                        
type RefObj = ref object

proc `[]`(val: static[int]) = # works with different name/overload or without static arg
  discard

template noRef*(T: typedesc): typedesc = # works without template indirection
  typeof(default(T)[])

proc `=destroy`(x: var noRef(RefObj)) =
  discard

proc foo =
  var x = new RefObj
  doAssert $(x[]) == "()"

# bug #11705
foo()