Mark wrapped abstract classes

This allows restoring reflection checks in testcase director_abstract.
This commit is contained in:
Olly Betts 2021-04-14 10:59:12 +12:00
commit 50f92dca08
2 changed files with 13 additions and 0 deletions

View file

@ -49,4 +49,13 @@ check::equal($me2->Color(1, 2, 3), 2, "Example2_get_color failed");
$me3 = new MyExample3();
check::equal($me3->Color(1, 2, 3), 3, "Example3_get_color failed");
$class = new ReflectionClass('Example1');
check::equal($class->isAbstract(), true, "Example1 abstractness failed");
$class = new ReflectionClass('Example2');
check::equal($class->isAbstract(), true, "Example2 abstractness failed");
$class = new ReflectionClass('Example3_i');
check::equal($class->isAbstract(), true, "Example3_i abstractness failed");
check::done();

View file

@ -1783,6 +1783,10 @@ public:
Printf(s_oinit, " SWIGTYPE_%s_ce = zend_register_internal_class(&SWIGTYPE_%s_internal_ce);\n", class_name, class_name);
}
if (Getattr(n, "abstracts") && !GetFlag(n, "feature:notabstract")) {
Printf(s_oinit, " SWIGTYPE_%s_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;\n", class_name);
}
{
Node *node = NewHash();
Setattr(node, "type", Getattr(n, "name"));