self_parameter.carbon 345 B

1234567891011
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. class Point {
  5. var x: i32;
  6. fn GetX(self: Point) -> i32 { return self.x; }
  7. fn GetY(self) -> i32 { return 0; }
  8. fn SetX(ref self, new_x: i32) {}
  9. }