Disallow ambiguous conversions between number literals and bytesXX types.

This commit is contained in:
Daniel Kirchner
2018-08-13 14:27:01 +02:00
parent 43db88b836
commit 7d7abeb149
26 changed files with 316 additions and 126 deletions
+3 -4
View File
@@ -114,8 +114,7 @@ This means that cyclic creation dependencies are impossible.
returns (bool ok)
{
// Check some arbitrary condition.
address tokenAddress = msg.sender;
return (keccak256(abi.encodePacked(newOwner)) & 0xff) == (bytes20(tokenAddress) & 0xff);
return currentOwner != newOwner;
}
}
@@ -811,12 +810,12 @@ as topics. The event call above can be performed in the same way as
contract C {
function f() public payable {
bytes32 _id = 0x420042;
uint256 _id = 0x420042;
log3(
bytes32(msg.value),
bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20),
bytes32(uint256(msg.sender)),
_id
bytes32(_id)
);
}
}