mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add control flow tests for "and" and "or" operators
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
struct S { bool f; }
|
||||
|
||||
contract C {
|
||||
function f() public view {
|
||||
S storage s;
|
||||
s.f && true;
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 3464: (95-96): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
@@ -0,0 +1,11 @@
|
||||
struct S { bool f; }
|
||||
|
||||
contract C {
|
||||
function f() public view {
|
||||
S storage s;
|
||||
s.f || true;
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 3464: (95-96): 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