I have an abstract contract that requires a contract to implement a function returning a bool
pragma solidity ^0.8.17;
abstract contract Lockable {
function lock() public virtual returns (bool);
}
But when I leave out the return in the implementing contract, the contract compiles and I'm able to deploy it.
contract Lock is Lockable {
function lock() public override returns (bool) {
}
}
I'm not able to compile an implementation that explicitly returns the wrong type, which is an expected behavior.
contract Lock is Lockable {
function lock() public override returns (bool) {
return "not a a bool";
}
}
Why am I allowed to not provide a return? If anyone has a link to a doc on this behavior feel free to share.