summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorcooldome <ariabushenko@gmail.com>2020-11-09 18:24:32 +0000
committerGitHub <noreply@github.com>2020-11-09 19:24:32 +0100
commit338602a4021771c8a1cbcedfe30738c67b957646 (patch)
treeb8adade922b9477b8b62ae2ac3acb3ba679cb037
parentc1664f93b0024b558ff359f13ab6cd2e6c1b5cc7 (diff)
downloadNim-338602a4021771c8a1cbcedfe30738c67b957646.tar.gz
fix #15825 (#15894)
* fix #15825

* better fix
-rw-r--r--compiler/semtypes.nim2
-rw-r--r--tests/destructor/tdestructor3.nim11
2 files changed, 12 insertions, 1 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index f111f6308..5feb25a59 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -1056,7 +1056,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode,
       # disable the bindOnce behavior for the type class
       result = recurse(paramType.base, true)
 
-  of tyAlias, tyOwned:
+  of tyAlias, tyOwned, tySink:
     result = recurse(paramType.base)
 
   of tySequence, tySet, tyArray, tyOpenArray,
diff --git a/tests/destructor/tdestructor3.nim b/tests/destructor/tdestructor3.nim
index eb49f3f15..3f5eb2cc1 100644
--- a/tests/destructor/tdestructor3.nim
+++ b/tests/destructor/tdestructor3.nim
@@ -172,3 +172,14 @@ when true: # D20200607T202043
   main2()
 
 
+
+#------------------------------------------------------------
+# Issue #15825
+
+type
+  Union = string | int | char
+
+proc run(a: sink Union) =
+  discard
+
+run("123")