Strip TypeLoc from EnumElementPattern

This commit is contained in:
Robert Widmann
2020-06-10 13:15:10 -07:00
parent fc9070c072
commit 2371e5c260
12 changed files with 159 additions and 126 deletions

View File

@@ -212,8 +212,8 @@ deriveBodyCodingKey_enum_stringValue(AbstractFunctionDecl *strValDecl, void *) {
} else {
SmallVector<ASTNode, 4> cases;
for (auto *elt : elements) {
auto *pat = new (C) EnumElementPattern(TypeLoc::withoutLoc(enumType),
SourceLoc(), DeclNameLoc(),
auto *baseTE = TypeExpr::createImplicit(enumType, C);
auto *pat = new (C) EnumElementPattern(baseTE, SourceLoc(), DeclNameLoc(),
DeclNameRef(), elt, nullptr);
pat->setImplicit();