Skip to content

Trait Coherence compile error with Mira #7187

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

Open
tritao opened this issue May 20, 2025 · 0 comments
Open

Trait Coherence compile error with Mira #7187

tritao opened this issue May 20, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tritao
Copy link
Contributor

tritao commented May 20, 2025

error: Trait is already implemented for type
  --> /home/joao/.forc/git/checkouts/standards-a75010d5ab7a85a4/1b00ccc05af5886ae3abd07a9a0ce6122738fc48/standards/src/src5.sw:45:1
   |
43 |   
44 |   
45 | / impl PartialEq for State {
46 | |     fn eq(self, other: Self) -> bool {
...  |
55 | |     }
56 | | }
   | |_^ Trait "eq" is already implemented for type "State".
   |
  ::: /home/joao/.forc/git/checkouts/standards-a75010d5ab7a85a4/7d35df95e0b96dc8ad188ab169fbbeeac896aae8/standards/src/src5.sw:45:1
   |
43 |   
44 |   
45 | / impl PartialEq for State {
46 | |     fn eq(self, other: Self) -> bool {
...  |
55 | |     }
56 | | }
   | |_- info: This is the already existing implementation of "eq" for "State".
   |
   = help: In Sway, there can be at most one implementation of a trait for any given type.
   = help: This property is called "trait coherence".
____

error: Trait is already implemented for type
  --> /home/joao/.forc/git/checkouts/standards-a75010d5ab7a85a4/1b00ccc05af5886ae3abd07a9a0ce6122738fc48/standards/src/src5.sw:45:1
   |
43 |   
44 |   
45 | / impl PartialEq for State {
46 | |     fn eq(self, other: Self) -> bool {
...  |
55 | |     }
56 | | }
   | |_^ Trait "neq" is already implemented for type "State".
   |
  ::: /home/joao/.forc/git/checkouts/standards-a75010d5ab7a85a4/7d35df95e0b96dc8ad188ab169fbbeeac896aae8/standards/src/src5.sw:45:1
   |
43 |   
44 |   
45 | / impl PartialEq for State {
46 | |     fn eq(self, other: Self) -> bool {
...  |
55 | |     }
56 | | }
   | |_- info: This is the already existing implementation of "neq" for "State".
   |
   = help: In Sway, there can be at most one implementation of a trait for any given type.
   = help: This property is called "trait coherence".
____

error: Trait is already implemented for type
  --> /home/joao/.forc/git/checkouts/standards-a75010d5ab7a85a4/7d35df95e0b96dc8ad188ab169fbbeeac896aae8/standards/src/src5.sw:45:1
   |
43 |   
44 |   
45 | / impl PartialEq for State {
46 | |     fn eq(self, other: Self) -> bool {
...  |
55 | |     }
56 | | }
   | |_^ Trait "eq" is already implemented for type "State".
   |
  ::: /home/joao/.forc/git/checkouts/standards-a75010d5ab7a85a4/1b00ccc05af5886ae3abd07a9a0ce6122738fc48/standards/src/src5.sw:45:1
   |
43 |   
44 |   
45 | / impl PartialEq for State {
46 | |     fn eq(self, other: Self) -> bool {
...  |
55 | |     }
56 | | }
   | |_- info: This is the already existing implementation of "eq" for "State".
   |
   = help: In Sway, there can be at most one implementation of a trait for any given type.
   = help: This property is called "trait coherence".
____

error: Trait is already implemented for type
  --> /home/joao/.forc/git/checkouts/standards-a75010d5ab7a85a4/7d35df95e0b96dc8ad188ab169fbbeeac896aae8/standards/src/src5.sw:45:1
   |
43 |   
44 |   
45 | / impl PartialEq for State {
46 | |     fn eq(self, other: Self) -> bool {
...  |
55 | |     }
56 | | }
   | |_^ Trait "neq" is already implemented for type "State".
   |
  ::: /home/joao/.forc/git/checkouts/standards-a75010d5ab7a85a4/1b00ccc05af5886ae3abd07a9a0ce6122738fc48/standards/src/src5.sw:45:1
   |
43 |   
44 |   
45 | / impl PartialEq for State {
46 | |     fn eq(self, other: Self) -> bool {
...  |
55 | |     }
56 | | }
   | |_- info: This is the already existing implementation of "neq" for "State".
   |
   = help: In Sway, there can be at most one implementation of a trait for any given type.
   = help: This property is called "trait coherence".

FYI @Dentosal

@tritao tritao self-assigned this May 20, 2025
@tritao tritao added the bug Something isn't working label May 20, 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
None yet
Development

No branches or pull requests

1 participant