Skip to content

Improve the system for handling nClass inheritance#90

Merged
perrydv merged 7 commits into
mainfrom
better-inherits
Oct 7, 2025
Merged

Improve the system for handling nClass inheritance#90
perrydv merged 7 commits into
mainfrom
better-inherits

Conversation

@perrydv

@perrydv perrydv commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

This PR has several pieces:

  • establishes a delayed handling of inheritance relationships (so that an nClass can be defined even before its base class)
  • makes an nClass (via its NC_InternalsClass) contain all_methodName_to_cpp_code_name to track the C++ version of method names obtained from base classes.
  • updates some of the internal name management, particularly making cpp_code_name not always get a unique suffix.
  • allows multiple inheritance from genericInterfaceBaseC via an interface_resolver<>, which in turn allows base classes to be interfaced from R separately from their derived classes.
  • makes more proper use of static and dynamic casting of shared_ptr in C++.

The delayed handling of inheritance happens in three steps, from nCompile:

  • Use method connect_inherit for each nClass. This lets everyone find their base classes.
  • Use method process_inherit for each nClass. This pulls together method names from base classes.
  • Use function NC_check_inheritance for each nClass. This checks for (disallowed by default) method overloading and mismatched method signatures (there are nOptions to control these rules).

@perrydv perrydv merged commit 972d987 into main Oct 7, 2025
5 checks passed
@perrydv perrydv deleted the better-inherits branch October 7, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant