-
Notifications
You must be signed in to change notification settings - Fork 80
Closed
Labels
cashc-compilerRelates to the cashc compilerRelates to the cashc compiler
Milestone
Description
We should fix the length of bytes types when using split:
bytes2 firstTwoBytes = test.split(2)[0];
The above does not work, when it should always be possible to type the length of the first element of the tuple. It should only be possible to type the length of the second element when the length of the original bytes element is typed.
The typing when getting both elements of the tuple is also wrong:
contract Demo() {
function example(bytes4 test) {
bytes3 firstHalf , bytes8 secondHalf = test.split(2);
require(firstHalf .length == 2);
require(secondHalf.length == 2);
}
}
firstHalf can only be bytes2 here, and secondHalf can also only be bytes2, because the original length of the bytes element is typed
Metadata
Metadata
Assignees
Labels
cashc-compilerRelates to the cashc compilerRelates to the cashc compiler