fail_mix_diamond_clash.carbon 656 B

12345678910111213141516171819202122232425262728293031323334
  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. package ExplorerTest api;
  7. __mixin M1 {
  8. fn F1[self: Self](x: Self) -> Self{
  9. return x;
  10. }
  11. }
  12. __mixin M2 {
  13. fn F2() {
  14. }
  15. __mix M1;
  16. }
  17. __mixin M3 {
  18. __mix M1;
  19. fn F3() {
  20. }
  21. }
  22. class C {
  23. __mix M2;
  24. __mix M3;
  25. // CHECK:STDERR: COMPILATION ERROR: fail_mix_diamond_clash.carbon:[[@LINE+1]]: Member named F1 (declared at fail_mix_diamond_clash.carbon:[[@LINE-18]]) is being mixed multiple times into C
  26. }
  27. fn Main() -> i32 {
  28. return 0;
  29. }