Merge pull request #10893 from ethereum/string2BytesSol2Yul

[Sol->Yul] Fixing string calldata to bytes calldata conversion.
This commit is contained in:
Daniel Kirchner
2021-02-04 10:33:40 +01:00
committed by GitHub
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"