mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Support class extension with `extends` Relates to #1881 Add support for: * Class extension with `extends` * Using base class methods and members
23 lines
635 B
Plaintext
23 lines
635 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
// RUN: %{not} %{explorer-run}
|
|
// RUN: %{not} %{explorer-run-trace}
|
|
|
|
package ExplorerTest api;
|
|
|
|
class C {
|
|
fn F() {}
|
|
}
|
|
|
|
class D extends C {
|
|
fn G() {}
|
|
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/class/fail_extends_final_class.carbon:[[@LINE+1]]: Base class `C` is `final` and cannot inherited. Add the `base` or `abstract` class prefix to `C` to allow it to be inherited
|
|
}
|
|
|
|
fn Main() -> i32 {
|
|
return 0;
|
|
}
|