Eliminate some pointless uses of the doomed DeclContext::getSelfTypeInContext()

This commit is contained in:
Doug Gregor
2016-12-02 09:12:40 -08:00
parent 6fffae7517
commit 18aa7104da
4 changed files with 8 additions and 15 deletions

View File

@@ -1331,13 +1331,7 @@ void TypeChecker::completePropertyBehaviorParameter(VarDecl *VD,
// Borrow the parameters from the requirement declaration.
SmallVector<ParameterList *, 2> ParamLists;
if (DC->isTypeContext()) {
auto self = new (Context) ParamDecl(/*let*/ true, SourceLoc(), SourceLoc(),
Identifier(), SourceLoc(),
Context.Id_self,
DC->getSelfTypeInContext(), DC);
self->setInterfaceType(DC->getSelfInterfaceType());
self->setImplicit();
auto self = ParamDecl::createSelf(SourceLoc(), DC);
ParamLists.push_back(ParameterList::create(Context, SourceLoc(),
self, SourceLoc()));
ParamLists.back()->get(0)->setImplicit();