binary_op.carbon.tmpl 492 B

12345678910111213141516171819202122232425262728
  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. //
  5. // AUTOUPDATE
  6. HEADER
  7. package User;
  8. class C {};
  9. impl C as Core.INTERFACE {
  10. fn Op[self: C](other: C) -> C {
  11. return {};
  12. }
  13. }
  14. impl C as Core.INTERFACEAssign {
  15. fn Op[addr self: C*](other: C) {}
  16. }
  17. fn TestOp(a: C, b: C) -> C {
  18. return a OP b;
  19. }
  20. fn TestAssign(a: C*, b: C) {
  21. *a OP= b;
  22. }