Merge pull request #4067 from ethereum/050

[BREAKING] Version 0.5.0
This commit is contained in:
chriseth
2018-05-23 18:11:20 +02:00
committed by GitHub
25 changed files with 274 additions and 115 deletions
+1 -1
View File
@@ -802,7 +802,7 @@ as topics. The event call above can be performed in the same way as
log3(
bytes32(msg.value),
bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20),
bytes32(msg.sender),
bytes32(uint256(msg.sender)),
_id
);
}
+10 -1
View File
@@ -762,7 +762,7 @@ Members
// Create a dynamic byte array:
bytes memory b = new bytes(200);
for (uint i = 0; i < b.length; i++)
b[i] = byte(i);
b[i] = byte(uint8(i));
return b;
}
}
@@ -975,6 +975,15 @@ cut off::
uint32 a = 0x12345678;
uint16 b = uint16(a); // b will be 0x5678 now
Since 0.5.0 explicit conversions between integers and fixed-size byte arrays
are only allowed, if both have the same size. To convert between integers and
fixed-size byte arrays of different size, they first have to be explicitly
converted to a matching size. This makes alignment and padding explicit::
uint16 x = 0xffff;
bytes32(uint256(x)); // pad on the left
bytes32(bytes2(x)); // pad on the right
.. index:: ! type;deduction, ! var
.. _type-deduction: