Files
carbon-lang/explorer/testdata/class/fail_abstract_method_base_class.carbon
T
f1ddded3a1 [explorer] Add support for abstract virtual methods (#3411)
Completing the work from #2761 by adding additional test cases. 
Closes #2512

---------

Co-authored-by: Maan2003 <manmeetmann2003@gmail.com>
Co-authored-by: Aleksei Ermakov <alexey@emkv.me>
2023-11-21 01:32:00 +00:00

23 lines
599 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;
abstract class A {
abstract fn Foo[self: Self]();
}
base class B {
extend base: A;
// CHECK:STDERR: COMPILATION ERROR: fail_abstract_method_base_class.carbon:[[@LINE+1]]: Error declaring `B`: non abstract class should implement abstract method `Foo`.
}
fn Main() -> i32 {
return 0;
}