mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
Casts from interface to class generally need to be dynamic. Fixes #189.
This commit is contained in:
parent
921a326865
commit
f82ca73c76
1 changed files with 2 additions and 2 deletions
|
@ -1090,11 +1090,11 @@ DValue* DtoCastClass(DValue* val, Type* _to)
|
|||
// 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue