mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-01 13:45:53 +01:00
Provides a first implementation iteration towards class prefix and extension, along with user-friendly error regarding missing implementation for #1881 **Explorer behavior** For class prefix `base` and `abstract`: ``` Class prefixes `base` and `abstract` are not supported yet ``` For extension with `extends`: ``` Class extension with `extends` is not supported yet ``` **Motivation** * Provides user-friendly error for these unsupported features * First implementation increment in supporting class prefix and extension.
25 lines
749 B
Plaintext
25 lines
749 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
|
|
//
|
|
// RUN: %{not} %{explorer} %s 2>&1 | \
|
|
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s
|
|
// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \
|
|
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s
|
|
// AUTOUPDATE: %{explorer} %s
|
|
|
|
package ExplorerTest api;
|
|
|
|
class A {
|
|
fn F() {}
|
|
}
|
|
|
|
class B extends A {
|
|
fn F() {}
|
|
// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/class/fail_class_extends.carbon:[[@LINE+1]]: Class extension with `extends` is not supported yet
|
|
}
|
|
|
|
fn Main() -> i32 {
|
|
return 0;
|
|
}
|