[AST] SwitchStmt only hold CaseStmt

Now that there is no way SwitchStmt to hold AST nodes other than
CaseStmt.
This commit is contained in:
Rintaro Ishizaki
2025-03-07 21:20:53 -08:00
parent 002d7d7cdf
commit 5eac58e1e0
19 changed files with 62 additions and 113 deletions

View File

@@ -209,7 +209,7 @@ deriveBodyCodingKey_enum_stringValue(AbstractFunctionDecl *strValDecl, void *) {
body = BraceStmt::create(C, SourceLoc(), ASTNode(returnStmt),
SourceLoc());
} else {
SmallVector<ASTNode, 4> cases;
SmallVector<CaseStmt *, 4> cases;
for (auto *elt : elements) {
auto *pat = EnumElementPattern::createImplicit(enumType, elt,
/*subPattern*/ nullptr,
@@ -270,7 +270,7 @@ deriveBodyCodingKey_init_stringValue(AbstractFunctionDecl *initDecl, void *) {
}
auto *selfRef = DerivedConformance::createSelfDeclRef(initDecl);
SmallVector<ASTNode, 4> cases;
SmallVector<CaseStmt *, 4> cases;
for (auto *elt : elements) {
// Skip the cases that would return unavailable elements since those can't
// be instantiated at runtime.