[svn r176] Fixed a bug with class constructors.

This commit is contained in:
Tomas Lindquist Olsen 2008-05-04 04:35:27 +02:00
parent 7ae4bc6477
commit a522719b85
5 changed files with 40 additions and 2 deletions

View file

@ -793,8 +793,11 @@ DValue* DtoNewClass(TypeClass* tc, NewExp* newexp)
}
// call constructor
if (newexp->arguments)
if (newexp->member)
{
assert(newexp->arguments != NULL);
return DtoCallClassCtor(tc, newexp->member, newexp->arguments, mem);
}
// return default constructed class
return new DImValue(tc, mem, false);