[Bug]: In IR, literal 0 has type uint256 even in contexts expecting bytes32
Open
bug
ir
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the issue:
In IR, when the literal 0 is used in a context where a fixed-length bytes type is expected, it is given type `uint256`. The results in, for example, assignments where the left-hand side has type `bytes32` and the right-hand side has type `uint256`.
### Code example to reproduce the issue:
```
contract Test {
function test() external {
bytes32 a = 0;
}
}
```
### Version:
0.9.3
### Relevant log output:
```shell
INFO:Printers:Contract Test
Function Test.test() (*)
Expression: a = 0
IRs:
a(bytes32) := 0(uint256)
```
Contributor guide
Assessment
This issue has not been assessed yet.