summary refs log tree commit diff stats
path: root/tests/closure
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-01-18 03:00:14 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-01-18 03:00:14 +0100
commit2309975f782bf59b240e3874d5c31b4b299eca5d (patch)
tree76392a3f5b4ae005e169b60511a14fa6a61c8da3 /tests/closure
parentbd933e6009b01768bfc62f4386aea9a09282beb6 (diff)
downloadNim-2309975f782bf59b240e3874d5c31b4b299eca5d.tar.gz
fixes yet another LL regression (Aporia compiles again)
Diffstat (limited to 'tests/closure')
-rw-r--r--tests/closure/texplicit_dummy_closure.nim22
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)