From 2a7b4fda78758005a9c67a0e5f83b7594d616b2a Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 1 Dec 2016 08:46:44 +0100 Subject: [PATCH] fixes #5081 --- compiler/ccgexprs.nim | 3 ++- tests/cpp/tasync_cpp.nim | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index feb70071a..b3ad6bbc3 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2152,7 +2152,8 @@ proc genNamedConstExpr(p: BProc, n: PNode): Rope = proc genConstSimpleList(p: BProc, n: PNode): Rope = var length = sonsLen(n) result = rope("{") - if n.kind == nkObjConstr and not isObjLackingTypeField(n.typ): + if n.kind == nkObjConstr and not isObjLackingTypeField(n.typ) and + not p.module.compileToCpp: addf(result, "{$1}", [genTypeInfo(p.module, n.typ)]) if n.len > 1: add(result, ",") for i in countup(ord(n.kind == nkObjConstr), length - 2): diff --git a/tests/cpp/tasync_cpp.nim b/tests/cpp/tasync_cpp.nim index 792f2938b..81215bd58 100644 --- a/tests/cpp/tasync_cpp.nim +++ b/tests/cpp/tasync_cpp.nim @@ -8,4 +8,7 @@ discard """ import jester import asyncdispatch, asyncnet +# bug #5081 +import nre + echo "hello"