From eea2a63607bcad56edda614e49635c4f32c941ae Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 30 Jan 2016 15:45:45 +0100 Subject: [PATCH] fixes #3794 --- compiler/ccgtrav.nim | 2 ++ tests/ccgbugs/tmissing_ccgtrav_unique_type.nim | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/ccgbugs/tmissing_ccgtrav_unique_type.nim diff --git a/compiler/ccgtrav.nim b/compiler/ccgtrav.nim index 5f59702e55..0da6396ead 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 0000000000..cb87eabd8c --- /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()