2019-02-05 19:29:57 +00:00
|
|
|
pragma experimental ABIEncoderV2;
|
|
|
|
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; }
|
|
|
|
}
|
|
|
|
// ----
|
2019-08-12 15:06:10 +00:00
|
|
|
// TypeError: (114-115): External function arguments of reference type are read-only.
|
2019-02-05 19:29:57 +00:00
|
|
|
// TypeError: (118-122): Type struct Test.S memory is not implicitly convertible to expected type struct Test.S calldata.
|
2019-08-12 15:06:10 +00:00
|
|
|
// TypeError: (178-179): External function arguments of reference type are read-only.
|
2019-02-05 19:29:57 +00:00
|
|
|
// TypeError: (182-183): Type struct Test.S memory is not implicitly convertible to expected type struct Test.S calldata.
|