Files
Nim/tests/template/twrongopensymchoice.nim
Adam Strzelecki e80465dacf tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:04:32 +02:00

25 lines
312 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 isMainModule:
main()