fail_base_method_define.carbon 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/inheritance/fail_base_method_define.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/inheritance/fail_base_method_define.carbon
  12. base class B {
  13. fn F();
  14. class C {
  15. fn F();
  16. }
  17. }
  18. class D {
  19. extend base: B;
  20. }
  21. // CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+4]]:6: error: out-of-line declaration requires a declaration in scoped entity [QualifiedDeclOutsideScopeEntity]
  22. // CHECK:STDERR: fn D.F() {}
  23. // CHECK:STDERR: ^
  24. // CHECK:STDERR:
  25. fn D.F() {}
  26. // CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+4]]:6: error: name `C` not found [NameNotFound]
  27. // CHECK:STDERR: fn D.C.F() {}
  28. // CHECK:STDERR: ^
  29. // CHECK:STDERR:
  30. fn D.C.F() {}