Mercurial > projects > ldc
changeset 906:f1ed7fe85138
Casts from interface to class generally need to be dynamic. Fixes #189.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 25 Jan 2009 12:35:11 +0100 |
parents | bd000a7fab18 |
children | acc834cb1657 |
files | gen/classes.cpp |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/classes.cpp Sat Jan 24 00:33:06 2009 +0100 +++ b/gen/classes.cpp Sun Jan 25 12:35:11 2009 +0100 @@ -1090,11 +1090,11 @@ // interface -> class if (fc->sym->isInterfaceDeclaration()) { Logger::println("interface cast"); - return DtoCastInterfaceToObject(val, _to); + return DtoDynamicCastInterface(val, _to); } // class -> class - static down cast else if (tc->sym->isBaseOf(fc->sym,NULL)) { - Logger::println("static down cast)"); + Logger::println("static down cast"); const LLType* tolltype = DtoType(_to); LLValue* rval = DtoBitCast(val->getRVal(), tolltype); return new DImValue(_to, rval);