代码:
contract A
{
uint public foo;
function A(uint _foo)
{
foo = _foo;
}
}
contract B
{
uint bar;
function B()
{
A a = new A(42);
bar = a.foo;
}
}
编译错误
Test:18:15: Error: Type function () returns (uint256) is not implicitly convertible to expected type uint256.
bar = a.foo;
^---^
如何读取另一个合同的公共变量?