mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-29 11:47:56 +00:00
committed by
Andreas Rumpf
parent
5a58caa9c1
commit
c343303efe
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)[]
|
||||
Reference in New Issue
Block a user