fail_abstract_method_abstract_class.carbon 638 B

1234567891011121314151617181920212223242526
  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. // RUN: %{not} %{explorer-run}
  7. // RUN: %{not} %{explorer-run-trace}
  8. package ExplorerTest api;
  9. abstract class A {
  10. abstract fn Foo[self: Self]();
  11. }
  12. abstract class B {
  13. extend base: A;
  14. }
  15. class C {
  16. extend base: B;
  17. // CHECK:STDERR: COMPILATION ERROR: fail_abstract_method_abstract_class.carbon:[[@LINE+1]]: Error declaring `C`: non abstract class should implement abstract method `Foo`.
  18. }
  19. fn Main() -> i32 {
  20. return 0;
  21. }