aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/types/zero_literal_to_bytesXX_explicit.sol
blob: 5d606089abae1b673fa0e194a387d1d08e7c615d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
contract C {
    function f() public pure {
      bytes1 b1 = bytes1(0);
      bytes2 b2 = bytes2(0);
      bytes3 b3 = bytes3(0);
      bytes4 b4 = bytes4(0);
      bytes8 b8 = bytes8(0);
      bytes16 b16 = bytes16(0);
      bytes32 b32 = bytes32(0);
      b1; b2; b3; b4; b8; b16; b32;
    }
    function g() public pure {
      bytes1 b1 = bytes1(0x000);
      bytes2 b2 = bytes2(0x00000);
      bytes3 b3 = bytes3(0x0000000);
      bytes4 b4 = bytes4(0x000000000);
      bytes8 b8 = bytes8(0x00000000000000000);
      b1; b2; b3; b4; b8;
    }
    function h() public pure {
      bytes1 b1 = bytes1(0x0);
      bytes2 b2 = bytes2(0x0);
      bytes3 b3 = bytes3(0x0);
      bytes4 b4 = bytes4(0x0);
      bytes8 b8 = bytes8(0x0);
      bytes16 b16 = bytes16(0x0);
      bytes32 b32 = bytes32(0x0);
      b1; b2; b3; b4; b8; b16; b32;
    }
}