texplicit_dummy_closure.nim 500 B

1234567891011121314151617181920212223242526
  1. discard """
  2. disabled: true
  3. """
  4. # This is a regression of the new lambda lifting; detected by Aporia
  5. import asyncio, sockets
  6. import os
  7. type
  8. Window = object
  9. oneInstSock*: AsyncSocket
  10. IODispatcher*: Dispatcher
  11. var
  12. win: Window
  13. proc initSocket() =
  14. win.oneInstSock = asyncSocket()
  15. #win.oneInstSock.handleAccept =
  16. proc test(s: AsyncSocket) =
  17. var client: AsyncSocket
  18. proc dummy(c: AsyncSocket) {.closure.} =
  19. discard
  20. client.handleRead = dummy
  21. test(win.oneInstSock)