You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Classes which derive from CXXTarget are expected to override a virtual function _create_target; however, CXXTarget does not actually declare a virtual _create_target. The code still works as is because CMakePPLang classes behave like Python classes, i.e., method resolution is done at runtime and can see all methods available to the object, including those from the derived classes.
We may want to take a page from C++'s playbook and have developers mark functions intended to override functions in some manner. Perhaps instead of:
where cpp_override wraps cpp_member, but additionally checks that one of the base classes declares a virtual function with the same signature (may need some type gymnastics for the self object).
To Reproduce
Look at the CXXTarget class's source code
Expected behavior CXXTarget should declare the virtual function.
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Describe the bug
Classes which derive from
CXXTarget
are expected to override a virtual function_create_target
; however,CXXTarget
does not actually declare a virtual_create_target
. The code still works as is because CMakePPLang classes behave like Python classes, i.e., method resolution is done at runtime and can see all methods available to the object, including those from the derived classes.We may want to take a page from C++'s playbook and have developers mark functions intended to override functions in some manner. Perhaps instead of:
it becomes:
where
cpp_override
wrapscpp_member
, but additionally checks that one of the base classes declares a virtual function with the same signature (may need some type gymnastics for the self object).To Reproduce
Look at the
CXXTarget
class's source codeExpected behavior
CXXTarget
should declare the virtual function.Additional context
N/A
The text was updated successfully, but these errors were encountered: