From 94e1488c242e8507beddf669b6ba776d016af0a6 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 10 Dec 2016 02:28:54 +0100 Subject: [PATCH] store typeinfo also in local hash table to prevent multiple 'extern' declarations in the generated C code --- compiler/ccgtypes.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 91086e642..b7e547528 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -1089,6 +1089,10 @@ proc genTypeInfo(m: BModule, t: PType): Rope = discard cgsym(m, "TNimNode") addf(m.s[cfsVars], "extern TNimType $1; /* $2 */$n", [result, rope(typeToString(t))]) + #return "(&".rope & result & ")".rope + #result = "NTI$1" % [rope($sig)] + # also store in local type section: + m.typeInfoMarker[sig] = result return "(&".rope & result & ")".rope result = "NTI$1" % [rope($sig)]