Merge pull request #8084 from LemonBoy/fix-7905
Discriminate gensym'd type names in sigHash
This commit is contained in:
commit
105a472dc5
2 changed files with 37 additions and 3 deletions
33
tests/types/t7905.nim
Normal file
33
tests/types/t7905.nim
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
discard """
|
||||
output: '''
|
||||
(member: "hello world")
|
||||
(member: 123.456)
|
||||
(member: "hello world", x: ...)
|
||||
(member: 123.456, x: ...)
|
||||
'''
|
||||
"""
|
||||
|
||||
template foobar(arg: typed): untyped =
|
||||
type
|
||||
MyType = object
|
||||
member: type(arg)
|
||||
|
||||
var myVar: MyType
|
||||
myVar.member = arg
|
||||
echo myVar
|
||||
|
||||
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