solidity/test/libsolidity/syntaxTests/viewPureChecker/returning_structs_fail.sol

14 lines
492 B
Solidity
Raw Normal View History

2018-07-04 09:25:45 +00:00
contract C {
struct S { uint x; }
S s;
function f() pure internal returns (S storage) {
return s;
}
function g() pure public {
f().x;
}
}
// ----
// TypeError 2527: (115-116): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
// TypeError 2527: (163-168): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".