diff --git a/gen/toir.cpp b/gen/toir.cpp index 7579726f..e0a31517 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -2881,7 +2881,7 @@ DValue* StructLiteralExp::toElem(IRState* p) #if DMDV2 else if (vd == sd->vthis) { IF_LOG Logger::println("initializing vthis"); - val = new DImValue(Type::tvoidptr, DtoBitCast(DtoNestedContext(loc, sd), getVoidPtrType())); + val = new DImValue(vd->type, DtoBitCast(DtoNestedContext(loc, sd), DtoType(vd->type))); } #endif else