solidity icon indicating copy to clipboard operation
solidity copied to clipboard

UB: can't create zero length array

Open fulldecent opened this issue 3 years ago • 0 comments

This code does not compile:

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.16;

contract E {
    uint256[0] bob;
}

with error:

Array with zero length specified.


I can't find any documentation that says I can't do this.


Reviewing live now during NFT/Web3 Community Service Hour. --> https://phor.net/#hour on twitch

fulldecent avatar Aug 09 '22 22:08 fulldecent