diff options
Diffstat (limited to 'tests/closure')
-rw-r--r-- | tests/closure/texplicit_dummy_closure.nim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/closure/texplicit_dummy_closure.nim b/tests/closure/texplicit_dummy_closure.nim new file mode 100644 index 000000000..ec608b31a --- /dev/null +++ b/tests/closure/texplicit_dummy_closure.nim @@ -0,0 +1,22 @@ + +# This is a regression of the new lambda lifting; detected by Aporia +import asyncio, sockets +import os + +type + Window = object + oneInstSock*: PAsyncSocket + IODispatcher*: PDispatcher + +var + win: Window + +proc initSocket() = + win.oneInstSock = asyncSocket() + #win.oneInstSock.handleAccept = + proc test(s: PAsyncSocket) = + var client: PAsyncSocket + proc dummy(c: PAsyncSocket) {.closure.} = + discard + client.handleRead = dummy + test(win.oneInstSock) |