Skip to content
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

[Feature] Avoid conflicting functions with common trait impls on UDT types #826

Closed
Will-Smith11 opened this issue Dec 13, 2024 · 1 comment · Fixed by #905
Closed

[Feature] Avoid conflicting functions with common trait impls on UDT types #826

Will-Smith11 opened this issue Dec 13, 2024 · 1 comment · Fixed by #905
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Will-Smith11
Copy link
Contributor

Component

sol-types, sol! macro, syn-solidity

Describe the feature you would like

On UDT types, currently there is a impl that converts to and from the underlying.

                /// Convert from the underlying value type.
                #[inline]
                pub const fn from(value: #underlying_rust) -> Self {
                    Self(value)
                }

                /// Return the underlying value.
                #[inline]
                pub const fn into(self) -> #underlying_rust {
                    self.0
                }

However these functions conflict with regular into and from trait impl's. Currently this will just render them useless (the impl on the struct will always override the trait impls). I recommend changing the naming to, from_underlying and into_underlying

Additional context

No response

@Will-Smith11 Will-Smith11 added the enhancement New feature or request label Dec 13, 2024
@Will-Smith11
Copy link
Contributor Author

actually a even better solution would just be implimenting the from and into traits for this type

@jenpaff jenpaff added this to Alloy Mar 4, 2025
@github-project-automation github-project-automation bot moved this to Todo in Alloy Mar 4, 2025
@jenpaff jenpaff added this to the v1.0 milestone Mar 4, 2025
@yash-atreya yash-atreya self-assigned this Mar 13, 2025
@yash-atreya yash-atreya linked a pull request Mar 13, 2025 that will close this issue
3 tasks
@yash-atreya yash-atreya moved this from Todo to In Progress in Alloy Mar 13, 2025
@yash-atreya yash-atreya moved this from In Progress to Ready for Review in Alloy Mar 13, 2025
@yash-atreya yash-atreya moved this from Ready for Review to Reviewed in Alloy Mar 13, 2025
@jenpaff jenpaff moved this from Reviewed to Completed in Alloy Mar 13, 2025
@github-project-automation github-project-automation bot moved this from Completed to Done in Alloy Mar 17, 2025
@grandizzy grandizzy moved this from Done to Completed in Alloy Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

3 participants