binary_op.carbon.tmpl 605 B

12345678910111213141516171819202122232425262728293031
  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. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. HEADER
  10. package User;
  11. class C {};
  12. impl C as Core.INTERFACE {
  13. fn Op[self: C](other: C) -> C {
  14. return {};
  15. }
  16. }
  17. impl C as Core.INTERFACEAssign {
  18. fn Op[addr self: C*](other: C) {}
  19. }
  20. fn TestOp(a: C, b: C) -> C {
  21. return a OP b;
  22. }
  23. fn TestAssign(a: C*, b: C) {
  24. *a OP= b;
  25. }