diff options
Diffstat (limited to 'test/libsolidity/syntaxTests/constructor_this.sol')
-rw-r--r-- | test/libsolidity/syntaxTests/constructor_this.sol | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/constructor_this.sol b/test/libsolidity/syntaxTests/constructor_this.sol new file mode 100644 index 00000000..9d22a161 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor_this.sol @@ -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. |