diff options
-rw-r--r-- | compiler/semtypes.nim | 2 | ||||
-rw-r--r-- | tests/destructor/tdestructor3.nim | 11 |
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") |