mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Previously it returned 32 bytes for all types, which was wasteful. This commit changes it to return the storage bytes of the underlying type.
		
			
				
	
	
		
			17 lines
		
	
	
		
			256 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			256 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL v3
 | |
| type MyInt128 is int128;
 | |
| type MyInt8 is int8;
 | |
| contract C {
 | |
|     // slot 0
 | |
|     MyInt128 a;
 | |
|     MyInt128 b;
 | |
|     // slot 1
 | |
|     MyInt128 c;
 | |
|     MyInt8 d;
 | |
|     MyInt8 e;
 | |
|     MyInt8 f;
 | |
|     MyInt8 g;
 | |
|     // slot 2
 | |
|     MyInt8 h;
 | |
| }
 |