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"