Files
Nim/tests/template/twrongopensymchoice.nim
2018-12-11 21:23:22 +01:00

25 lines
304 B
Nim

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 true:
main()