DMD Issue 5416 - null should have a type of its own

This commit is contained in:
Alexey Prokhin
2011-12-15 13:31:39 +04:00
parent 88cff99bd4
commit edc4a5f003
7 changed files with 21 additions and 4 deletions

View File

@@ -96,6 +96,8 @@ void ReturnStatement::toIR(IRState* p)
if (!exp && (p->topfunc() == p->mainFunc)) {
v = LLConstant::getNullValue(p->mainFunc->getReturnType());
} else {
if (exp->op == TOKnull)
exp->type = p->func()->type->next;
#if DMDV2
DValue* dval = 0;
// call postblit if necessary