mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-27 00:53:23 +01:00
Fix #265: Use declared struct type in initexpr.
This commit is contained in:
committed by
David Nadlinger
parent
c77a6341af
commit
db9edaf053
@@ -1396,7 +1396,10 @@ LLConstant* DtoConstInitializer(Loc loc, Type* type, Initializer* init)
|
||||
if (!init)
|
||||
{
|
||||
Logger::println("const default initializer for %s", type->toChars());
|
||||
_init = DtoConstExpInit(loc, type, type->defaultInit());
|
||||
Expression *initExp = type->defaultInit();
|
||||
if (type->ty == Ttypedef)
|
||||
initExp->type = type; // This carries the typedef type into toConstElem.
|
||||
_init = DtoConstExpInit(loc, type, initExp);
|
||||
}
|
||||
else if (ExpInitializer* ex = init->isExpInitializer())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user