diff options
-rw-r--r-- | compiler/semtypinst.nim | 3 | ||||
-rw-r--r-- | tests/ccgbugs/tcgbug.nim | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index a07d91241..73b618f46 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -153,6 +153,9 @@ proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode = discard of nkSym: result.sym = replaceTypeVarsS(cl, n.sym) + if result.sym.typ.kind == tyEmpty: + # don't add the 'void' field + result = newNode(nkRecList, n.info) of nkRecWhen: var branch: PNode = nil # the branch to take for i in countup(0, sonsLen(n) - 1): diff --git a/tests/ccgbugs/tcgbug.nim b/tests/ccgbugs/tcgbug.nim index 417b909ae..c0037935a 100644 --- a/tests/ccgbugs/tcgbug.nim +++ b/tests/ccgbugs/tcgbug.nim @@ -21,3 +21,13 @@ q(a) echo "success" + +# bug #833 + +type + PFuture*[T] = ref object + value*: T + finished*: bool + cb: proc (future: PFuture[T]) {.closure.} + +var k = PFuture[void]() |