mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update code to review comments
This commit is contained in:
+16
-5
@@ -1,11 +1,22 @@
|
||||
struct S { bool f; }
|
||||
struct S {
|
||||
uint v;
|
||||
}
|
||||
|
||||
using {bitand as &} for S;
|
||||
|
||||
function bitand(S storage, S storage) returns (S storage) {
|
||||
S storage rTmp;
|
||||
return rTmp;
|
||||
}
|
||||
|
||||
contract C {
|
||||
function f() public view {
|
||||
S storage s;
|
||||
s.f && true;
|
||||
S s;
|
||||
function f() public {
|
||||
S storage sTmp;
|
||||
sTmp & s;
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 3464: (95-96): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError 3464: (145-149): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError 3464: (234-238): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
struct S { bool f; }
|
||||
struct S {
|
||||
uint v;
|
||||
}
|
||||
|
||||
using {bitor as |} for S;
|
||||
|
||||
function bitor(S storage, S storage) returns (S storage) {
|
||||
S storage rTmp;
|
||||
return rTmp;
|
||||
}
|
||||
|
||||
contract C {
|
||||
function f() public view {
|
||||
S storage s;
|
||||
s.f || true;
|
||||
S s;
|
||||
function f() public {
|
||||
S storage sTmp;
|
||||
sTmp | s;
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 3464: (95-96): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError 3464: (143-147): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError 3464: (232-236): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
|
||||
Reference in New Issue
Block a user