mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Modules are pure.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
==== Source: a ====
|
||||
struct S { uint x; }
|
||||
==== Source: b ====
|
||||
import "a" as A;
|
||||
struct T { uint x; }
|
||||
contract C {
|
||||
function f() public pure {
|
||||
T;
|
||||
A.S;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (b:90-91): Statement has no effect.
|
||||
// Warning: (b:101-104): Statement has no effect.
|
||||
@@ -0,0 +1,15 @@
|
||||
==== Source: a ====
|
||||
struct S { uint[2] mS; }
|
||||
==== Source: b ====
|
||||
import "a" as A;
|
||||
struct T { A.S[2] mT; }
|
||||
==== Source: c ====
|
||||
pragma experimental ABIEncoderV2;
|
||||
import "b" as B;
|
||||
contract C {
|
||||
function f(B.T memory y, B.A.S memory z) public pure returns (uint, uint) {
|
||||
z = B.A.S([uint(2), 3]);
|
||||
y = B.T([z, z]);
|
||||
return (y.mT[0].mS[0], z.mS[0]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user