twasmoved_error.nim 729 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. discard """
  2. cmd: '''nim c --mm:arc $file'''
  3. errormsg: "'=wasMoved' is not available for type <Game>; routine: main"
  4. """
  5. # bug #19291
  6. const
  7. screenWidth = 800
  8. screenHeight = 450
  9. var
  10. ready = false
  11. type
  12. Game = object
  13. proc `=destroy`(x: var Game) =
  14. assert ready, "Window is already opened"
  15. ready = false
  16. proc `=sink`(x: var Game; y: Game) {.error.}
  17. proc `=copy`(x: var Game; y: Game) {.error.}
  18. proc `=wasMoved`(x: var Game) {.error.}
  19. proc initGame(width, height: int32, title: string): Game =
  20. assert not ready, "Window is already closed"
  21. ready = true
  22. proc update(x: Game) = discard
  23. proc main =
  24. var g = initGame(screenWidth, screenHeight, "Tetris raylib")
  25. g.update()
  26. var g2 = g
  27. echo "hello"
  28. main()