Skip to content

[cpyrt] Raise TypeError when a template argument names no C++ type - #67

Merged
aaronj0 merged 1 commit into
compiler-research:mainfrom
aaronj0:typeerror-no-cpp-name
Sep 3, 2026
Merged

[cpyrt] Raise TypeError when a template argument names no C++ type#67
aaronj0 merged 1 commit into
compiler-research:mainfrom
aaronj0:typeerror-no-cpp-name

Conversation

@aaronj0

@aaronj0 aaronj0 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Every Python object has a name, so an object naming no C++ type reached AddTypeName's fallback, where GetType() returned null; that null was then pushed as a template argument and dereferenced by IsEnumType. Skip such an argument, and report the string-based path's failure as TypeError like the type-based one already does.

@aaronj0
aaronj0 requested a review from guitargeek September 2, 2026 08:28
@aaronj0
aaronj0 force-pushed the typeerror-no-cpp-name branch from dde9e93 to cf5ade4 Compare September 2, 2026 10:39
Every Python object has a __name__, so an object naming no C++ type
reached AddTypeName's fallback, where GetType() returned null; that null
was then pushed as a template argument and dereferenced by IsEnumType.
Skip such an argument, and report the string-based path's failure as
TypeError like the type-based one already does.
@aaronj0
aaronj0 force-pushed the typeerror-no-cpp-name branch from cf5ade4 to 03b16e6 Compare September 2, 2026 10:50

@guitargeek guitargeek left a comment

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.

LGTM!

@aaronj0
aaronj0 merged commit bdf63ae into compiler-research:main Sep 3, 2026
9 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