add testcase for #5926 (#14965)

This commit is contained in:
flywind 2020-07-11 23:09:41 +08:00 • committed by GitHub
commit 21772b6419
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

22
tests/generics/t5926.nim Normal file
View file

@ -0,0 +1,22 @@
discard """
action: compile
"""
type
SomeObj[T] = object
template useSomeObj[T]() =
var retObj: SomeObj[T]
useSomeObj[void]()
useSomeObj[int]()
type
Data*[T] = object
x: T
template test*[T](xxx: T) =
let data = Data[T](x: xxx)
test(1)