Skip to content

Commit db27051

Browse files
committed
Test for old behaviour.
1 parent e154d43 commit db27051

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
contract C {
2+
function removeSignature(bytes memory x) internal pure returns (bytes memory r) {
3+
r = new bytes(x.length - 4);
4+
for (uint i = 0; i < x.length - 4; ++i)
5+
r[i] = x[i + 4];
6+
}
7+
function g(bytes2, bytes2) public {}
8+
function h(uint16, uint16) public {}
9+
function f() public returns (bytes memory) {
10+
uint16 x = 0x1234;
11+
return removeSignature(abi.encodeCall(this.g, (0x1234, bytes2(x))));
12+
}
13+
function f2() public returns (bytes memory) {
14+
bytes2 x = 0x1234;
15+
return removeSignature(abi.encodeCall(this.h, (0x1234, uint16(x))));
16+
}
17+
}
18+
// ====
19+
// compileViaYul: also
20+
// ----
21+
// f() -> 0x20, 0x40, 0x1234, 0x1234000000000000000000000000000000000000000000000000000000000000
22+
// f2() -> 0x20, 0x40, 0x1234, 0x1234

0 commit comments

Comments
 (0)