fail_extends_final_class.carbon 563 B

1234567891011121314151617181920
  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. class C {
  8. fn F() {}
  9. }
  10. class D extends C {
  11. fn G() {}
  12. // CHECK:STDERR: COMPILATION ERROR: explorer/testdata/class/fail_extends_final_class.carbon:[[@LINE+1]]: Base class `C` is `final` and cannot be inherited. Add the `base` or `abstract` class prefix to `C` to allow it to be inherited
  13. }
  14. fn Main() -> i32 {
  15. return 0;
  16. }