mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Require extend before base: BaseType; (#3459)
This commit is contained in:
+15
-3
@@ -7,8 +7,10 @@
|
||||
base class B {}
|
||||
|
||||
class D {
|
||||
base: B;
|
||||
base: B1;
|
||||
extend base: B2;
|
||||
base class Nested;
|
||||
private base class PrivateNested;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: - filename: base.carbon
|
||||
@@ -24,12 +26,22 @@ class D {
|
||||
// CHECK:STDOUT: {kind: 'ClassDefinitionStart', text: '{', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'BaseIntroducer', text: 'base'},
|
||||
// CHECK:STDOUT: {kind: 'BaseColon', text: ':'},
|
||||
// CHECK:STDOUT: {kind: 'NameExpr', text: 'B'},
|
||||
// CHECK:STDOUT: {kind: 'NameExpr', text: 'B1'},
|
||||
// CHECK:STDOUT: {kind: 'BaseDecl', text: ';', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'BaseIntroducer', text: 'base'},
|
||||
// CHECK:STDOUT: {kind: 'DeclModifierKeyword', text: 'extend'},
|
||||
// CHECK:STDOUT: {kind: 'BaseColon', text: ':'},
|
||||
// CHECK:STDOUT: {kind: 'NameExpr', text: 'B2'},
|
||||
// CHECK:STDOUT: {kind: 'BaseDecl', text: ';', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'ClassIntroducer', text: 'class'},
|
||||
// CHECK:STDOUT: {kind: 'DeclModifierKeyword', text: 'base'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'Nested'},
|
||||
// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 12},
|
||||
// CHECK:STDOUT: {kind: 'ClassIntroducer', text: 'class'},
|
||||
// CHECK:STDOUT: {kind: 'AccessModifierKeyword', text: 'private'},
|
||||
// CHECK:STDOUT: {kind: 'DeclModifierKeyword', text: 'base'},
|
||||
// CHECK:STDOUT: {kind: 'Name', text: 'PrivateNested'},
|
||||
// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 22},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
Reference in New Issue
Block a user