From 416aa921fa0cfefda5f3ee30329c8378f2e2008a Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 17 Nov 2017 18:02:47 +0100 Subject: [PATCH] fixes #6757 --- compiler/ccgexprs.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 5ea7198394..45b2be5587 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2275,7 +2275,13 @@ proc getDefaultValue(p: BProc; typ: PType; info: TLineInfo): Rope = result = "{{$1}}" % [genTypeInfo(p.module, t, info)] else: result = rope"{}" - of tyArray, tyTuple: result = rope"{}" + of tyTuple: + result = rope"{" + for i in 0 ..< typ.len: + if i > 0: result.add ", " + result.add getDefaultValue(p, typ.sons[i], info) + result.add "}" + of tyArray: result = rope"{}" of tySet: if mapType(t) == ctArray: result = rope"{}" else: result = rope"0"