parent
5a58caa9c1
commit
c343303efe
2 changed files with 19 additions and 1 deletions
18
tests/ccgbugs/t6756.nim
Normal file
18
tests/ccgbugs/t6756.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import typetraits
|
||||
type
|
||||
A[T] = ref object
|
||||
v: T
|
||||
|
||||
template templ(o: A, op: untyped): untyped =
|
||||
type T = type(o.v)
|
||||
|
||||
var res: A[T]
|
||||
|
||||
block:
|
||||
var it {.inject.}: T
|
||||
it = o.v
|
||||
res = A[T](v: op)
|
||||
res
|
||||
|
||||
let a = A[int](v: 1)
|
||||
echo templ(a, it + 2)[]
|
||||
Loading…
Add table
Add a link
Reference in a new issue