mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Explorer: Mixin phase 1 (#2069)
* Replay changes from pre-force-push mixin branch * Base MixinPseudoType off of the new InterfaceType * Add more test cases. Also removed an unnecessary check that would have already been handled by the parser. * WIP detect member clashes during mixing mixins * Implement fuzzer changes * Implement member name clash check when mixing mixins * Modify parser and lexer for experimental mixin feature * Add comments * Update explorer/testdata/mixin/simple-mix-in-mixin.carbon Co-authored-by: josh11b <josh11b@users.noreply.github.com> * Update explorer/testdata/mixin/use-mixin-method-in-class-method.carbon Co-authored-by: josh11b <josh11b@users.noreply.github.com> * Make code review changes Co-authored-by: josh11b <josh11b@users.noreply.github.com>
This commit is contained in:
co-authored by
josh11b
parent
661a3c3907
commit
037c99e2fb
@@ -154,6 +154,13 @@ auto ResolveControlFlow(Nonnull<Declaration*> declaration) -> ErrorOr<Success> {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DeclarationKind::MixinDeclaration: {
|
||||
auto& mixin_decl = cast<MixinDeclaration>(*declaration);
|
||||
for (Nonnull<Declaration*> member : mixin_decl.members()) {
|
||||
CARBON_RETURN_IF_ERROR(ResolveControlFlow(member));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DeclarationKind::InterfaceDeclaration: {
|
||||
auto& iface_decl = cast<InterfaceDeclaration>(*declaration);
|
||||
for (Nonnull<Declaration*> member : iface_decl.members()) {
|
||||
@@ -173,6 +180,7 @@ auto ResolveControlFlow(Nonnull<Declaration*> declaration) -> ErrorOr<Success> {
|
||||
case DeclarationKind::AssociatedConstantDeclaration:
|
||||
case DeclarationKind::SelfDeclaration:
|
||||
case DeclarationKind::AliasDeclaration:
|
||||
case DeclarationKind::MixDeclaration:
|
||||
// do nothing
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user