[Sol->Yul] Fixing string calldata to bytes calldata conversion.

This commit is contained in:
Djordje Mijovic
2021-02-04 09:30:19 +01:00
parent 8a4e6acdac
commit 530435439d
3 changed files with 30 additions and 2 deletions
@@ -0,0 +1,9 @@
contract C {
function f(bytes calldata c) public returns (string calldata s) {
return string(c);
}
}
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 3, "abc" -> 0x20, 3, "abc"
@@ -0,0 +1,9 @@
contract C {
function f(string calldata s) public returns (bytes calldata m) {
return bytes(s);
}
}
// ====
// compileViaYul: also
// ----
// f(string): 0x20, 3, "abc" -> 0x20, 3, "abc"