First cast up chain, if that fails, cast down

This commit is contained in:
Jason Turner
2014-03-26 10:52:56 -06:00
parent 56b036052f
commit 656b438002
3 changed files with 83 additions and 46 deletions

View File

@@ -19,8 +19,9 @@ assert_equal(23, t.val)
// in a shared_ptr<TestBaseType>. This is testing our ability
// to detect that and do the down casting for the user automatically
// at runtime
var d := derived_type_factory();
assert_equal(t.derived_only_func(), 19);
var d := derived_type_factory();
assert_equal(d.derived_only_func(), 19);