Don't blow up with recursive objects
This commit is contained in:
parent
af66258dca
commit
e39baf46fc
2 changed files with 18 additions and 4 deletions
|
|
@ -2,6 +2,8 @@ discard """
|
|||
output: '''
|
||||
(member: "hello world")
|
||||
(member: 123.456)
|
||||
(member: "hello world", x: ...)
|
||||
(member: 123.456, x: ...)
|
||||
'''
|
||||
"""
|
||||
|
||||
|
|
@ -16,3 +18,16 @@ template foobar(arg: typed): untyped =
|
|||
|
||||
foobar("hello world")
|
||||
foobar(123.456'f64)
|
||||
|
||||
template foobarRec(arg: typed): untyped =
|
||||
type
|
||||
MyType = object
|
||||
member: type(arg)
|
||||
x: ref MyType
|
||||
|
||||
var myVar: MyType
|
||||
myVar.member = arg
|
||||
echo myVar
|
||||
|
||||
foobarRec("hello world")
|
||||
foobarRec(123.456'f64)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue