mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 14:31:03 +01:00
Closes #2994 --------- Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ base class C {
|
||||
|
||||
class E {
|
||||
var x: i32;
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_extend_after_var.carbon:[[@LINE+1]]: `extend base:` declaration must not be after `var` or `mix` declarations in a class.
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_extend_after_var.carbon:[[@LINE+1]]: `extend base:` declarations after the first declaration in the class are not yet supported
|
||||
extend base: C;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// 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
|
||||
|
||||
package ExplorerTest api;
|
||||
|
||||
class E {
|
||||
base class C {
|
||||
}
|
||||
|
||||
// This should be allowed, but Explorer forbids it until the problem from
|
||||
// https://github.com/carbon-language/carbon-lang/issues/2994 can be fixed.
|
||||
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_extend_member_class.carbon:[[@LINE+1]]: `extend base:` declarations after the first declaration in the class are not yet supported
|
||||
extend base: C;
|
||||
}
|
||||
|
||||
fn Main() -> i32 {
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user