mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
16 lines
600 B
Solidity
16 lines
600 B
Solidity
|
// Previously, the type information for A was not yet available at the point of
|
||
|
// "new A".
|
||
|
contract B {
|
||
|
A a;
|
||
|
function B() public {
|
||
|
a = new A(this);
|
||
|
}
|
||
|
}
|
||
|
contract A {
|
||
|
function A(address a) internal {}
|
||
|
}
|
||
|
// ----
|
||
|
// Warning: (112-155): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
|
||
|
// Warning: (172-205): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
|
||
|
// TypeError: (140-145): Contract with internal constructor cannot be created directly.
|