From 2fe8635e5a22c03afaee10c012867c7eab401e41 Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Tue, 2 Nov 2010 13:22:10 +0300 Subject: [PATCH] Struct constructors are supported now --- gen/toir.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gen/toir.cpp b/gen/toir.cpp index a12021ff..c2a90d69 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -1697,6 +1697,16 @@ DValue* NewExp::toElem(IRState* p) #if DMDV2 if (ts->sym->isNested() && ts->sym->vthis) DtoResolveNestedContext(loc, ts->sym, mem); + + // call constructor + if (member) + { + Logger::println("Calling constructor"); + assert(arguments != NULL); + member->codegen(Type::sir); + DFuncValue dfn(member, member->ir.irFunc->func, mem); + return DtoCallFunction(loc, ts, &dfn, arguments); + } #endif return new DImValue(type, mem); }