Stricter check for member access to "this" in constructor.

This commit is contained in:
Daniel Kirchner
2018-04-13 15:57:13 +02:00
parent c3dc67d0e0
commit be37e3a912
4 changed files with 76 additions and 4 deletions
@@ -0,0 +1,12 @@
contract C {
function f() public pure {}
constructor() public {
C c = this;
c.f(); // this does not warn now, but should warn in the future
this.f();
(this).f();
}
}
// ----
// Warning: (172-176): "this" used in constructor. Note that external functions of a contract cannot be called while it is being constructed.
// Warning: (191-195): "this" used in constructor. Note that external functions of a contract cannot be called while it is being constructed.