fixes #940
This commit is contained in:
parent
fd532b6dab
commit
729e048a32
6 changed files with 38 additions and 5 deletions
24
tests/template/twrongopensymchoice.nim
Normal file
24
tests/template/twrongopensymchoice.nim
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
discard """
|
||||
output: '''10'''
|
||||
"""
|
||||
|
||||
# bug #940
|
||||
|
||||
type
|
||||
Foo* = ref object
|
||||
b*: int
|
||||
|
||||
proc new*(this: var Foo) =
|
||||
assert this != nil
|
||||
this.b = 10
|
||||
|
||||
proc new*(T: typedesc[Foo]): Foo =
|
||||
system.new(result)
|
||||
twrongopensymchoice.new(result)
|
||||
|
||||
proc main =
|
||||
var f = Foo.new()
|
||||
echo f.b
|
||||
|
||||
when isMainModule:
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue