Files
carbon-lang/explorer/testdata/class/fail_extends_final_class.carbon
T
Adrien Leravat 7c19ef5be3 Explorer: Support class extension (#1946)
Support class extension with `extends`
Relates to #1881 

Add support for:
* Class extension with `extends`
* Using base class methods and members
2022-10-21 08:08:07 -07:00

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;
}