Skip to content

[Bug] sol macro doesn't work with re-exported alloy::sol_types module #944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Maximkaaa opened this issue Apr 30, 2025 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@Maximkaaa
Copy link

Component

sol-types

What version of Alloy are you on?

0.15

Operating System

None

Describe the bug

When trying to use sol! macro from the alloy::sol_types module it fails to compile with this error:

error[E0432]: unresolved import `alloy_sol_types`
   --> src/integration-tests/tests/stress/mod.rs:334:5
    |
334 | /     alloy::sol_types::sol!(
335 | |         contract Fibonacci {
336 | |             function fib(uint256 n) public returns (uint256 b);
337 | |         }
338 | |     );
    | |_____^ no external crate `alloy_sol_types`
    |
    = note: this error originates in the macro `alloy::sol_types::sol` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this crate through its public re-export instead
@Maximkaaa Maximkaaa added the bug Something isn't working label Apr 30, 2025
@github-project-automation github-project-automation bot moved this to Todo in Alloy Apr 30, 2025
@DaniPopes
Copy link
Member

This is a known limitation, please use alloy::sol directly: https://github.com/alloy-rs/alloy/blob/20154fc9c5e34c7e88dddfda51fdd84ee97b6084/crates/alloy/src/lib.rs#L43-L55

@DaniPopes DaniPopes closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Alloy Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants