Skip to content

[interop] Filter deleted functions from Python-visible overload sets - #66

Merged
aaronj0 merged 1 commit into
compiler-research:mainfrom
aaronj0:filter-deleted-overloads
Sep 2, 2026
Merged

[interop] Filter deleted functions from Python-visible overload sets#66
aaronj0 merged 1 commit into
compiler-research:mainfrom
aaronj0:filter-deleted-overloads

Conversation

@aaronj0

@aaronj0 aaronj0 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

A deleted function is not callable, yet it still entered the overload set and contributed a spurious conversion error to every failed-call report. That defeats SetDetailedException's rule that failures which are all C++ exceptions of one type are re-raised as that type.

Fixes tests in the ROOT migration as well as test34_no_ctors_in_base which expects TypeError for a class whose only constructors are deleted.

A deleted function is not callable, yet it still entered the overload
set and contributed a spurious conversion error to every failed-call
report. That defeats SetDetailedException's rule that failures which are
all C++ exceptions of one type are re-raised as that type.

Un-xfails test34_no_ctors_in_base in test_crossinheritance.py, which
expects TypeError for a class whose only constructors are deleted.
remove_deleted_methods(std::vector<interop::TCppMethod_t>& methods) {
methods.erase(std::remove_if(methods.begin(), methods.end(),
[](interop::TCppMethod_t m) {
return Cpp::IsFunctionDeleted(m);

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.

I guess here the question for @Vipul-Cariappa is if the new system suggests deleted functions and is that what general c++ do?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I believe this is filtering the lookup and not the overload resolution. This should be fine.

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.

Ok, thank you!

@vgvassilev vgvassilev left a comment

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.

LGTM!

@aaronj0
aaronj0 merged commit ba1e2eb into compiler-research:main Sep 2, 2026
14 checks passed
@aaronj0
aaronj0 deleted the filter-deleted-overloads branch September 2, 2026 09:25
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.

3 participants