@@ -6597,7 +6597,7 @@ SubscriptDecl::createDeserialized(ASTContext &Context, DeclName Name,
6597
6597
assert (ElementTy && " Deserialized element type must not be null" );
6598
6598
auto *const SD = new (Context)
6599
6599
SubscriptDecl (Name, SourceLoc (), StaticSpelling, SourceLoc (), nullptr ,
6600
- SourceLoc (), TypeLoc () , Parent, GenericParams);
6600
+ SourceLoc (), /* ElementTyR= */ nullptr , Parent, GenericParams);
6601
6601
SD->setElementInterfaceType (ElementTy);
6602
6602
return SD;
6603
6603
}
@@ -6607,11 +6607,12 @@ SubscriptDecl *SubscriptDecl::create(ASTContext &Context, DeclName Name,
6607
6607
StaticSpellingKind StaticSpelling,
6608
6608
SourceLoc SubscriptLoc,
6609
6609
ParameterList *Indices, SourceLoc ArrowLoc,
6610
- TypeLoc ElementTy , DeclContext *Parent,
6610
+ TypeRepr *ElementTyR , DeclContext *Parent,
6611
6611
GenericParamList *GenericParams) {
6612
+ assert (ElementTyR);
6612
6613
auto *const SD = new (Context)
6613
6614
SubscriptDecl (Name, StaticLoc, StaticSpelling, SubscriptLoc, Indices,
6614
- ArrowLoc, ElementTy , Parent, GenericParams);
6615
+ ArrowLoc, ElementTyR , Parent, GenericParams);
6615
6616
return SD;
6616
6617
}
6617
6618
@@ -6627,7 +6628,7 @@ SubscriptDecl *SubscriptDecl::createImported(ASTContext &Context, DeclName Name,
6627
6628
6628
6629
auto *const SD = ::new (DeclPtr)
6629
6630
SubscriptDecl (Name, SourceLoc (), StaticSpellingKind::None, SubscriptLoc,
6630
- Indices, ArrowLoc, TypeLoc () , Parent,
6631
+ Indices, ArrowLoc, /* ElementTyR= */ nullptr , Parent,
6631
6632
/* GenericParams=*/ nullptr );
6632
6633
SD->setElementInterfaceType (ElementTy);
6633
6634
SD->setClangNode (ClangN);
0 commit comments