Skip to content

[cpyrt] Detect enum arguments by type in overload priority - #75

Open
aaronj0 wants to merge 1 commit into
compiler-research:mainfrom
aaronj0:enum-args-by-type-priority
Open

[cpyrt] Detect enum arguments by type in overload priority#75
aaronj0 wants to merge 1 commit into
compiler-research:mainfrom
aaronj0:enum-args-by-type-priority

Conversation

@aaronj0

@aaronj0 aaronj0 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

GetPriority() deprioritizes enum arguments so that a competing integer overload wins, since C++ has no implicit int->enum conversion, but it detected them with IsEnumScope(GetScope(name)). GetScope does not resolve an enum name to a scope, so the penalty never applied. Query the argument type with IsEnumType as well, per the existing FIXME.

GetPriority() deprioritizes enum arguments so that a competing integer
overload wins, since C++ has no implicit int->enum conversion, but it
detected them with IsEnumScope(GetScope(name)). GetScope does not
resolve an enum name to a scope, so the penalty never applied. Query the
argument type with IsEnumType as well, per the existing FIXME.
@aaronj0
aaronj0 requested a review from guitargeek September 3, 2026 13:31
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