Don't blow up with recursive objects

This commit is contained in:
LemonBoy 2018-06-22 15:09:35 +02:00
commit e39baf46fc
2 changed files with 18 additions and 4 deletions

View file

@ -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)