Remodel the Interface for Implicit TypeExprs

Make it slightly easier to enforce the invariant that implicit TypeExpr
nodes have a contextual type set.
This commit is contained in:
Robert Widmann
2020-04-23 16:13:30 -07:00
parent 09db2902d2
commit 7ed188216e
8 changed files with 68 additions and 55 deletions

View File

@@ -42,8 +42,9 @@ deriveBodyBridgedNSError_enum_nsErrorDomain(AbstractFunctionDecl *domainDecl,
auto self = domainDecl->getImplicitSelfDecl();
auto selfRef = new (C) DeclRefExpr(self, DeclNameLoc(), /*implicit*/ true);
auto stringType = TypeExpr::createForDecl(DeclNameLoc(), C.getStringDecl(),
domainDecl, /*implicit*/ true);
auto stringType = TypeExpr::createImplicitForDecl(
DeclNameLoc(), C.getStringDecl(), domainDecl,
C.getStringDecl()->getInterfaceType());
auto initReflectingCall =
CallExpr::createImplicit(C, stringType,
{ selfRef }, { C.getIdentifier("reflecting") });