You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! In the following solidity code, we are assigning a value to a literal array.
contractTest {
function test() public {
[hex""][0] =hex"30";
}
}
The type of the literal array is inferred as array of bytes0, as evident from the error message output by Solang. I believe bytes0 should not be a valid type, and hex"" should be inferred as bytes1.
Compile: solang compile a.sol --target solana
Output:
error: implicit conversion would truncate from 'bytes1' to 'bytes0'
┌─ /home/xxx/a.sol:4:18
│
4 │ [hex""][0] = hex"30";
│
The text was updated successfully, but these errors were encountered:
Hi! In the following solidity code, we are assigning a value to a literal array.
The type of the literal array is inferred as
array of bytes0
, as evident from the error message output by Solang. I believebytes0
should not be a valid type, andhex""
should be inferred asbytes1
.Compile:
solang compile a.sol --target solana
Output:
The text was updated successfully, but these errors were encountered: