fail_impl_adds_self.carbon 573 B

123456789101112131415161718192021222324
  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. interface I {
  8. fn G();
  9. }
  10. class C {
  11. impl as I {
  12. // CHECK:STDERR: COMPILATION ERROR: fail_impl_adds_self.carbon:[[@LINE+3]]: type error in member of implementation
  13. // CHECK:STDERR: expected: fn () -> ()
  14. // CHECK:STDERR: actual: fn [self: class C]() -> ()
  15. fn G[self: Self]() { }
  16. }
  17. }
  18. fn Main() -> i32 {
  19. return 0;
  20. }