mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
22
tests/generics/t5926.nim
Normal file
22
tests/generics/t5926.nim
Normal 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)
|
||||
Reference in New Issue
Block a user