bytes_cast.sol 334 B

12345678910111213141516
  1. contract C {
  2. function test1(bytes10 x) public returns (bytes8) {
  3. return x;
  4. }
  5. function test2(bytes10 x) public returns (bytes10) {
  6. return x;
  7. }
  8. function test3(bytes10 x) public returns (bytes12) {
  9. return x;
  10. }
  11. }
  12. // ---- Expect: diagnostics ----
  13. // error: 3:10-11: implicit conversion would truncate from bytes10 to bytes8