diff options
author | Araq <rumpf_a@web.de> | 2019-07-19 22:38:35 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-07-19 22:38:35 +0200 |
commit | 67a6effb7bf4d319c8bafd65c75a4da47e007c24 (patch) | |
tree | c0c576067701ec541ab5ac5727d5ed41459b66ff /compiler | |
parent | affe1be47c9161d2c994f01c84be49b02e4f922d (diff) | |
download | Nim-67a6effb7bf4d319c8bafd65c75a4da47e007c24.tar.gz |
fixes #11745
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgexprs.nim | 7 |
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" |