fail_field_member_name_clash.carbon 692 B

1234567891011121314151617181920212223
  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 M {
  8. fn F[self: Self](x: Self) -> Self{
  9. return x;
  10. }
  11. }
  12. class C {
  13. let F: i32 = 0;
  14. __mix M;
  15. // CHECK:STDERR: COMPILATION ERROR: fail_field_member_name_clash.carbon:[[@LINE+1]]: Member named F (declared at fail_field_member_name_clash.carbon:[[@LINE-6]]) cannot be mixed into C because it clashes with an existing member with the same name (declared at fail_field_member_name_clash.carbon:[[@LINE-2]])
  16. }
  17. fn Main() -> i32 {
  18. return 0;
  19. }