summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/ccgtypes.nim2
-rw-r--r--tests/arc/t14472.nim22
2 files changed, 22 insertions, 2 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index 0df7c8d2a..6c82a140b 100644
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -1487,7 +1487,7 @@ proc genTypeInfoV1(m: BModule, t: PType; info: TLineInfo): Rope =
   elif origType.attachedOps[attachedDeepCopy] != nil:
     genDeepCopyProc(m, origType.attachedOps[attachedDeepCopy], result)
 
-  if optTinyRtti in m.config.globalOptions and t.kind == tyObject:
+  if optTinyRtti in m.config.globalOptions and t.kind == tyObject and sfImportc notin t.sym.flags:
     let v2info = genTypeInfoV2(m, origType, info)
     addf(m.s[cfsTypeInit3], "$1->typeInfoV1 = (void*)&$2; $2.typeInfoV2 = (void*)$1;$n", [
       v2info, result])
diff --git a/tests/arc/t14472.nim b/tests/arc/t14472.nim
index 47ed77f4c..4ef661161 100644
--- a/tests/arc/t14472.nim
+++ b/tests/arc/t14472.nim
@@ -1,6 +1,6 @@
 discard """
   valgrind: true
-  cmd: "nim c --gc:arc -d:useMalloc $file"
+  cmd: "nim cpp --gc:arc -d:useMalloc --deepcopy:on $file"
 """
 
 type
@@ -21,3 +21,23 @@ proc bork() : ImportedScene =
   add(result.meshes, Mesh(material: mats[0]))
 
 var s = bork()
+
+
+#------------------------------------------------------------------------
+# issue #15543
+
+import tables
+
+type
+  cdbl {.importc: "double".} = object
+
+  MyObject = ref object of RootObj
+    y: Table[string, cdbl]
+        
+
+proc test =
+  var x = new(MyObject)
+
+test()
+
+