Skip to content

Commit

Permalink
close #11705; add a testcase (#21128)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout committed Dec 18, 2022
1 parent 100b304 commit 53eed2b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/template/t11705.nim
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 53eed2b

Please sign in to comment.