solidity/test/libsolidity/smtCheckerTests/functions/constructor_this.sol

14 lines
537 B
Solidity
Raw Normal View History

pragma experimental SMTChecker;
contract C {
function f() public pure {}
2020-06-23 12:14:24 +00:00
constructor() {
C c = this;
c.f(); // this does not warn now, but should warn in the future
this.f();
(this).f();
}
}
// ----
2020-06-23 12:14:24 +00:00
// Warning 5805: (197-201): "this" used in constructor. Note that external functions of a contract cannot be called while it is being constructed.
// Warning 5805: (216-220): "this" used in constructor. Note that external functions of a contract cannot be called while it is being constructed.