solidity/test/libsolidity/syntaxTests/structs/memory_to_calldata.sol
2022-04-01 23:41:18 -05:00

10 lines
462 B
Solidity

pragma abicoder v2;
contract Test {
struct S { int a; }
function f(S calldata s) external { s = S(2); }
function g(S calldata s) external { S memory m; s = m; }
}
// ----
// TypeError 7407: (118-122='S(2)'): Type struct Test.S memory is not implicitly convertible to expected type struct Test.S calldata.
// TypeError 7407: (182-183='m'): Type struct Test.S memory is not implicitly convertible to expected type struct Test.S calldata.