Skip to content

Add various type reflection interfaces for cppyy/numba#913

Merged
aaronj0 merged 1 commit into
compiler-research:mainfrom
aaronj0:type-compare-api
Apr 22, 2026
Merged

Add various type reflection interfaces for cppyy/numba#913
aaronj0 merged 1 commit into
compiler-research:mainfrom
aaronj0:type-compare-api

Conversation

@aaronj0
Copy link
Copy Markdown
Collaborator

@aaronj0 aaronj0 commented Apr 22, 2026

Revived #534.
This was earlier motivated by arg match scoring interfaces for numba, and recently a ROOT commit aliasing size() to __len__ for container-like classes: root-project/root@cccbacc, so I opened a fresh PR and also addressed the last comment on making signedness an out parameter

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 88.57143% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.23%. Comparing base (a727d4f) to head (146715e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/CppInterOp/CppInterOp.cpp 88.57% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #913      +/-   ##
==========================================
+ Coverage   81.18%   81.23%   +0.05%     
==========================================
  Files          13       13              
  Lines        4931     4966      +35     
==========================================
+ Hits         4003     4034      +31     
- Misses        928      932       +4     
Files with missing lines Coverage Δ
include/CppInterOp/CppInterOp.h 95.55% <ø> (ø)
lib/CppInterOp/CppInterOp.cpp 88.55% <88.57%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
include/CppInterOp/CppInterOp.h 95.55% <ø> (ø)
lib/CppInterOp/CppInterOp.cpp 88.55% <88.57%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aaronj0
Copy link
Copy Markdown
Collaborator Author

aaronj0 commented Apr 22, 2026

Seeing we now have RemoveTypeQualifier I will drop the implementation of GetUnqualifiedType as it is no longer required. However I have extended it with an All enum so that would mimic a call to GetUnqualifiedType instead of making a verbose call on the client-side like Cpp::RemoveTypeQualifier(a, Cpp::QualKind::Const | Cpp::QualKind::Volatile |Cpp::QualKind::Restrict )

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

EXPECT_TRUE(Cpp::IsFloatingType(Cpp::GetVariableType(Decls[2])));
EXPECT_FALSE(Cpp::IsFloatingType(Cpp::GetVariableType(Decls[3])));
EXPECT_FALSE(Cpp::IsFloatingType(Cpp::GetVariableType(Decls[4])));
EXPECT_FALSE(Cpp::IsFloatingType(0));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use nullptr [modernize-use-nullptr]

Suggested change
EXPECT_FALSE(Cpp::IsFloatingType(0));
EXPECT_FALSE(Cpp::IsFloatingType(nullptr));

Copy link
Copy Markdown
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aaronj0 aaronj0 merged commit 9965d8c into compiler-research:main Apr 22, 2026
34 checks passed
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.

2 participants