parent
100b304ac2
commit
53eed2be45
1 changed files with 17 additions and 0 deletions
17
tests/template/t11705.nim
Normal file
17
tests/template/t11705.nim
Normal file
|
|
@ -0,0 +1,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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue