summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-07-19 22:38:35 +0200
committerAraq <rumpf_a@web.de>2019-07-19 22:38:35 +0200
commit67a6effb7bf4d319c8bafd65c75a4da47e007c24 (patch)
treec0c576067701ec541ab5ac5727d5ed41459b66ff /compiler
parentaffe1be47c9161d2c994f01c84be49b02e4f922d (diff)
downloadNim-67a6effb7bf4d319c8bafd65c75a4da47e007c24.tar.gz
fixes #11745
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 22951b4cb..273117bc7 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -2709,9 +2709,14 @@ proc getDefaultValue(p: BProc; typ: PType; info: TLineInfo): Rope =
   of tyBool: result = rope"NIM_FALSE"
   of tyEnum, tyChar, tyInt..tyInt64, tyUInt..tyUInt64: result = rope"0"
   of tyFloat..tyFloat128: result = rope"0.0"
-  of tyCString, tyString, tyVar, tyLent, tyPointer, tyPtr, tySequence, tyUntyped,
+  of tyCString, tyVar, tyLent, tyPointer, tyPtr, tyUntyped,
      tyTyped, tyTypeDesc, tyStatic, tyRef, tyNil:
     result = rope"NIM_NIL"
+  of tyString, tySequence:
+    if p.config.selectedGC == gcDestructors:
+      result = rope"{0, NIM_NIL}"
+    else:
+      result = rope"NIM_NIL"
   of tyProc:
     if t.callConv != ccClosure:
       result = rope"NIM_NIL"