summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-06-21 20:45:00 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-06-21 20:45:00 +0200
commit0db3c670ac46d431b86275d245b3b4ec0dd6c372 (patch)
treeccdf9ed37f704ff7df48b9ee9cb3ef40807e9e2a /tests
parent35df59b3ce9912cf91499c9830549e9535d37b19 (diff)
downloadNim-0db3c670ac46d431b86275d245b3b4ec0dd6c372.tar.gz
closes #11533
Diffstat (limited to 'tests')
-rw-r--r--tests/destructor/tsimpleclosure.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/destructor/tsimpleclosure.nim b/tests/destructor/tsimpleclosure.nim
index c6d25d0b6..43b5cb2b6 100644
--- a/tests/destructor/tsimpleclosure.nim
+++ b/tests/destructor/tsimpleclosure.nim
@@ -2,6 +2,9 @@ discard """
   cmd: '''nim c --newruntime $file'''
   output: '''a b
 70
+hello
+hello
+hello
 2 2  alloc/dealloc pairs: 0'''
 """
 
@@ -26,5 +29,20 @@ proc wrap =
   foo fIt
 
 wrap()
+
+# bug #11533
+proc say = echo "hello"
+
+# Error: internal error: genAssignment: tyNil
+var err0: proc() = say
+err0()
+
+var ok0: proc()
+ok0 = say
+ok0()
+
+var ok1 = say
+ok1()
+
 let (a, d) = allocCounters()
 discard cprintf("%ld %ld  alloc/dealloc pairs: %ld\n", a, d, system.allocs)