Skip to content

Add type name to macro-generated function names#674

Merged
ktoso merged 1 commit intoswiftlang:mainfrom
sidepelican:macro_unique_name
Apr 6, 2026
Merged

Add type name to macro-generated function names#674
ktoso merged 1 commit intoswiftlang:mainfrom
sidepelican:macro_unique_name

Conversation

@sidepelican
Copy link
Copy Markdown
Contributor

Functions generated by the @JavaImplementation macro currently use context.makeUniqueName.
While this ensures uniqueness within the local macro expansion context, it is not globally unique.
As a result, using the same function name across multiple classes leads to symbol collisions.

2026-04-06 17 22 40 2026-04-06 17 30 12

This PR adds the class name as a prefix to the generated function names to ensure global uniqueness.

@sidepelican sidepelican requested a review from ktoso as a code owner April 6, 2026 08:30
@ktoso ktoso merged commit cc4a702 into swiftlang:main Apr 6, 2026
49 of 61 checks passed
@ktoso
Copy link
Copy Markdown
Collaborator

ktoso commented Apr 6, 2026

Lgtm thanks! Nightly ci is broken right now, this is not on us

@sidepelican sidepelican deleted the macro_unique_name branch April 7, 2026 01: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.

2 participants