diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-01-30 15:45:45 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-01-30 15:45:45 +0100 |
commit | eea2a63607bcad56edda614e49635c4f32c941ae (patch) | |
tree | 5cf6ca4bb3b98bcf66a34ed67c9bef6347e540e7 | |
parent | fb149d2eef81ee815c969eb72aeedda991b6ef4f (diff) | |
download | Nim-eea2a63607bcad56edda614e49635c4f32c941ae.tar.gz |
fixes #3794
-rw-r--r-- | compiler/ccgtrav.nim | 2 | ||||
-rw-r--r-- | tests/ccgbugs/tmissing_ccgtrav_unique_type.nim | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/compiler/ccgtrav.nim b/compiler/ccgtrav.nim index 5f59702e5..0da6396ea 100644 --- a/compiler/ccgtrav.nim +++ b/compiler/ccgtrav.nim @@ -57,6 +57,8 @@ proc parentObj(accessor: Rope; m: BModule): Rope {.inline.} = proc genTraverseProc(c: var TTraversalClosure, accessor: Rope, typ: PType) = if typ == nil: return + + let typ = getUniqueType(typ) var p = c.p case typ.kind of tyGenericInst, tyGenericBody, tyTypeDesc: diff --git a/tests/ccgbugs/tmissing_ccgtrav_unique_type.nim b/tests/ccgbugs/tmissing_ccgtrav_unique_type.nim new file mode 100644 index 000000000..cb87eabd8 --- /dev/null +++ b/tests/ccgbugs/tmissing_ccgtrav_unique_type.nim @@ -0,0 +1,12 @@ + +# bug #3794 + + +import options + +proc getRef*(): Option[int] = + return none(int) + +proc getChild*() = + let iter = iterator (): int {.closure.} = + let reference = getRef() |