this.sol 528 B

12345678910111213141516171819
  1. function test1() returns (address) {
  2. return address(this);
  3. }
  4. function test2(int this) returns (int) {
  5. return this * 3;
  6. }
  7. contract that {
  8. // We can shadow this with another variable
  9. function foo(int this, int super) public pure returns (int) {
  10. return this + super;
  11. }
  12. }
  13. // ---- Expect: diagnostics ----
  14. // error: 2:17-21: this not allowed outside contract
  15. // warning: 5:20-24: 'this' shadows name of a builtin
  16. // warning: 11:19-23: 'this' shadows name of a builtin
  17. // warning: 11:29-34: 'super' shadows name of a builtin