diff --git a/test/src/example.h b/test/src/example.h index 72f6783d..32d66d56 100644 --- a/test/src/example.h +++ b/test/src/example.h @@ -205,4 +205,22 @@ protected: static void _bind_methods() {} }; +class ExamplePureVirtualBase : public Object { + GDCLASS(ExamplePureVirtualBase, Object); + +protected: + static void _bind_methods() {} + + virtual int test_function() = 0; +}; + +class ExamplePureVirtual : public ExamplePureVirtualBase { + GDCLASS(ExamplePureVirtual, ExamplePureVirtualBase); + +protected: + static void _bind_methods() {} + + int test_function() override { return 25; } +}; + #endif // EXAMPLE_CLASS_H diff --git a/test/src/register_types.cpp b/test/src/register_types.cpp index dbb37d90..5b99d385 100644 --- a/test/src/register_types.cpp +++ b/test/src/register_types.cpp @@ -26,6 +26,9 @@ void initialize_example_module(ModuleInitializationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(true); ClassDB::register_abstract_class(); + + GDREGISTER_VIRTUAL_CLASS(ExamplePureVirtualBase); + GDREGISTER_CLASS(ExamplePureVirtual); } void uninitialize_example_module(ModuleInitializationLevel p_level) {