twrongopensymchoice.nim 304 B

12345678910111213141516171819202122232425
  1. discard """
  2. output: '''10'''
  3. """
  4. # bug #940
  5. type
  6. Foo* = ref object
  7. b*: int
  8. proc new*(this: var Foo) =
  9. assert this != nil
  10. this.b = 10
  11. proc new*(T: typedesc[Foo]): Foo =
  12. system.new(result)
  13. twrongopensymchoice.new(result)
  14. proc main =
  15. var f = Foo.new()
  16. echo f.b
  17. when true:
  18. main()