Skip to content

fix(sol-macro): fix UDT NAME constant generation stringify typo - #1145

Merged
DaniPopes merged 1 commit into
alloy-rs:mainfrom
Ysh204:fix/udt-name-stringify-typo
Jul 5, 2026
Merged

DaniPopes merged 1 commit into
alloy-rs:mainfrom
Ysh204:fix/udt-name-stringify-typo

Conversation

@Ysh204

@Ysh204 Ysh204 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Motivation

The UDVT macro expansion generated an incorrect NAME constant due to a typo in
expand/udt.rs.

The generated code used:

stringify!(@name)

instead of:

stringify!(#name)

As a result, NAME evaluated to "@ name" instead of the Solidity type name.

Solution

Replace @name with #name so the generated NAME constant expands to the
correct identifier.

Also adds a regression test asserting:

assert_eq!(MyType::NAME, "MyType");

@github-project-automation github-project-automation Bot moved this to Reviewed in Alloy Jul 5, 2026
@DaniPopes
DaniPopes enabled auto-merge (squash) July 5, 2026 12:22
@DaniPopes
DaniPopes merged commit 2df1477 into alloy-rs:main Jul 5, 2026
31 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in Alloy Jul 5, 2026
@Ysh204
Ysh204 deleted the fix/udt-name-stringify-typo branch July 5, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants