Closed makcandrov closed 5 months ago
sol! macro
0.7.0
None
hex
alloy_sol_types::sol! { contract Contract { function foo() external { bytes memory b = hex"ab"; } } }
error: prefix `hex` is unknown --> src\main.rs:4:30 | 4 | bytes memory b = hex"ab"; | ^^^ unknown prefix | = note: prefixed identifiers and literals are reserved since Rust 2021 help: consider inserting whitespace here | 4 | bytes memory b = hex "ab"; | +
unicode
alloy_sol_types::sol! { contract Contract { function foo() external { string memory s = unicode"a"; } } }
error: prefix `unicode` is unknown --> src\main.rs:4:31 | 4 | string memory s = unicode"a"; | ^^^^^^^ unknown prefix | = note: prefixed identifiers and literals are reserved since Rust 2021 help: consider inserting whitespace here | 4 | string memory s = unicode "a"; | +
This is a known limitation, rust fails lexing the code before even passing it to the macro.
https://github.com/alloy-rs/core/tree/main/crates/syn-solidity#known-limitations
Component
sol! macro
What version of Alloy are you on?
0.7.0
Operating System
None
Describe the bug
hex
:unicode
: