mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update ViewPureChecker tests for user type operator with view modifier
This commit is contained in:
parent
1a8564545e
commit
5942912bf1
@ -16,15 +16,4 @@ function f() view {
|
||||
Int.wrap(0) + Int.wrap(0);
|
||||
}
|
||||
|
||||
function g() {
|
||||
Int.wrap(0) + Int.wrap(0);
|
||||
}
|
||||
|
||||
function h() pure {
|
||||
Int.wrap(0) + Int.wrap(0);
|
||||
}
|
||||
|
||||
|
||||
// ----
|
||||
// Warning 2018: (220-267): Function state mutability can be restricted to view
|
||||
// TypeError 2527: (293-318): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
|
||||
|
@ -0,0 +1,30 @@
|
||||
type Int is uint8;
|
||||
|
||||
using {
|
||||
add as +
|
||||
} for Int;
|
||||
|
||||
|
||||
function f_view() view {}
|
||||
|
||||
function add(Int, Int) view returns (Int) {
|
||||
f_view();
|
||||
return Int.wrap(0);
|
||||
}
|
||||
|
||||
function f() view {
|
||||
Int.wrap(0) + Int.wrap(0);
|
||||
}
|
||||
|
||||
function g() {
|
||||
Int.wrap(0) + Int.wrap(0);
|
||||
}
|
||||
|
||||
function h() pure {
|
||||
Int.wrap(0) + Int.wrap(0);
|
||||
}
|
||||
|
||||
|
||||
// ----
|
||||
// Warning 2018: (220-267): Function state mutability can be restricted to view
|
||||
// TypeError 2527: (293-318): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
|
Loading…
Reference in New Issue
Block a user