-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
In #114 we are making any type that contains a shielded type impossible to be returned from a public/external function. The goal here is to prevent silly mistakes and force devs to type-cast to fully public types when returning values.
However, I have noticed that our solidity fork does not consider user defined value types (udvts). For example this test fails:
// test/libsolidity/syntaxTests/visibility/shielded_udvt_return.sol
type mysbool is sbool;
contract Deployer {
mysbool private storedBoolean;
// SHOULD RETURN AN ERROR, BUT DOESN'T
function getStoredBooleanFailExternal() external returns (mysbool) {
return storedBoolean;
}
// SHOULD RETURN AN ERROR, BUT DOESN'T
function getStoredBooleanFailPublic() public returns (mysbool) {
return storedBoolean;
}
}
// ----
// DeclarationError 7492: (217-222): Shielded objects cannot be returned from public or external functions. Use internal or private functions or cast to an unshielded type.
// DeclarationError 7492: (321-326): Shielded objects cannot be returned from public or external functions. Use internal or private functions or cast to an unshielded type.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels