aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/parsing/constructor_allowed_this.sol
blob: b66253e4f5e08529b6f4a2549871df2d6e697474 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
contract A {
    function a() public pure {
    }
}
contract B {
    constructor(C) public {
    }
    function b(C) public returns (A) {
        return new A();
    }
}
contract C {
    B m_b;
    C m_c;
    constructor(C other_c) public {
        m_c = other_c;
        m_b = new B(this);
        m_b.b(this).a();
        g(this).f();
        other_c.f();
        m_c.f();
    }
    function f() public pure {
    }
    function g(C) public view returns (C) {
        return m_c;
    }
}