summary refs log tree commit diff stats
path: root/tests/closure/texplicit_dummy_closure.nim
blob: 9cd8c8ca970a954955c85e225c129d3041b24c01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This is a regression of the new lambda lifting; detected by Aporia
import asyncio, sockets
import os

type
  Window = object
    oneInstSock*: AsyncSocket
    IODispatcher*: Dispatcher

var
  win: Window

proc initSocket() =
  win.oneInstSock = asyncSocket()
  #win.oneInstSock.handleAccept =
  proc test(s: AsyncSocket) =
    var client: AsyncSocket
    proc dummy(c: AsyncSocket) {.closure.} =
      discard
    client.handleRead = dummy
  test(win.oneInstSock)