-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Trait Coherence bug #6232
Comments
Once fixed the repo will be deleted. |
How does the original struct looks like? Does it contains anything that cannot be automatically encoded/decoded? I ask because in the minimum repro, the empty The question is why the original type cannot be encoded/decoded. And if it can't, there should be no auto-impl and thus no trait coherence issues if an implementation is provided. CC: @xunilrj |
I dont know if this is the intended solution but simply importing the type in contract a will allow the contract to be compiled
Incase it is the intended solution the error should be improved. Either way, i hope you can use that as a workaround for now |
If Once it is imported into |
I think this is already fixed by this commit: f4f9c13 |
In version contract;
use std::constants::ZERO_B256;
abi MyContract {
fn call_a();
}
abi Module {
fn call_b();
}
configurable {
CONTRACT: ContractId = ContractId::from(ZERO_B256),
}
impl MyContract for Contract {
fn call_a() {
let a = abi(Module, CONTRACT.bits());
let b = abi(Module, CONTRACT.bits());
}
} The problem is Strange bug. We should be able to write the code above instead of extracting into another line to pass in the variable into the |
Context
A contract calls another contract to return a struct.
This results in an error message indicating that
AbiDecode
trait must be implemented.Upon implementing a template
AbiDecode
trait the subsequentforc build
errors with aTrait Coherence
error meaning the attached repo cannot be built with or without the trait - blocking production in a deadlock.Check out the following minimal repo which pins the version to
0.60.0
https://github.com/Braqzen/sway-trait-coherence-bug
The text was updated successfully, but these errors were encountered: