Disallow packed encoding of literals.

This commit is contained in:
chriseth
2018-07-03 01:02:00 +02:00
parent 4649f9202a
commit f7a9c4203e
6 changed files with 20 additions and 32 deletions
@@ -5,4 +5,4 @@ contract C {
}
// ----
// Warning: (92-93): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
// TypeError: (92-93): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
@@ -1,9 +0,0 @@
pragma experimental "v0.5.0";
contract C {
function k() pure public returns (bytes) {
return abi.encodePacked(1);
}
}
// ----
// TypeError: (122-123): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.