mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Correct spacing
This commit is contained in:
parent
c276086f3f
commit
f5989fb5e0
@ -211,18 +211,18 @@ storage and is not able to call ``f``. Contract ``E`` is derived from ``C`` and
|
|||||||
|
|
||||||
contract D {
|
contract D {
|
||||||
function readData() {
|
function readData() {
|
||||||
C c = new C();
|
C c = new C();
|
||||||
local = c.f(7); // error: member "f" is not visible
|
local = c.f(7); // error: member "f" is not visible
|
||||||
c.setData(3);
|
c.setData(3);
|
||||||
uint local = c.getData();
|
uint local = c.getData();
|
||||||
local = c.compute(3,5); // error: member "compute" is not visible
|
local = c.compute(3,5); // error: member "compute" is not visible
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contract E is C {
|
contract E is C {
|
||||||
function g() {
|
function g() {
|
||||||
C c = new C();
|
C c = new C();
|
||||||
uint val = compute(3,5); // acces to internal member (from derivated to parent contract)
|
uint val = compute(3,5); // acces to internal member (from derivated to parent contract)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,12 +244,12 @@ be done at declaration.
|
|||||||
contract C {
|
contract C {
|
||||||
uint public data = 42;
|
uint public data = 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
contract Caller {
|
contract Caller {
|
||||||
C c = new C();
|
C c = new C();
|
||||||
function f() {
|
function f() {
|
||||||
uint local = c.data();
|
uint local = c.data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
The accessor functions have external visibility. If the
|
The accessor functions have external visibility. If the
|
||||||
@ -260,11 +260,11 @@ it is evaluated as state variable and if it is accessed externally
|
|||||||
::
|
::
|
||||||
|
|
||||||
contract C {
|
contract C {
|
||||||
uint public data;
|
uint public data;
|
||||||
function x() {
|
function x() {
|
||||||
data = 3; // internal access
|
data = 3; // internal access
|
||||||
uint val = this.data(); // external access
|
uint val = this.data(); // external access
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
The next example is a bit more complex:
|
The next example is a bit more complex:
|
||||||
|
Loading…
Reference in New Issue
Block a user