@@ -7292,31 +7292,13 @@ Expr *ExprRewriter::convertLiteralInPlace(Expr *literal,
7292
7292
return nullptr ;
7293
7293
7294
7294
// Form a reference to the builtin conversion function.
7295
- // FIXME: Bogus location info.
7296
- Expr *base = TypeExpr::createImplicitHack (literal->getLoc (), type,
7297
- tc.Context );
7298
-
7299
- Expr *unresolvedDot = new (tc.Context ) UnresolvedDotExpr (
7300
- base, SourceLoc (),
7301
- witness.getDecl ()->getFullName (),
7302
- DeclNameLoc (base->getEndLoc ()),
7303
- /* Implicit=*/ true );
7304
- (void )tc.typeCheckExpression (unresolvedDot, dc);
7305
-
7306
- cs.cacheExprTypes (unresolvedDot);
7307
-
7308
- ConcreteDeclRef builtinRef = unresolvedDot->getReferencedDecl ();
7309
- if (!builtinRef) {
7310
- tc.diagnose (base->getLoc (), brokenBuiltinProtocolDiag);
7311
- return nullptr ;
7312
- }
7313
7295
7314
7296
// Set the builtin initializer.
7315
7297
if (auto stringLiteral = dyn_cast<StringLiteralExpr>(literal))
7316
- stringLiteral->setBuiltinInitializer (builtinRef );
7298
+ stringLiteral->setBuiltinInitializer (witness );
7317
7299
else {
7318
7300
cast<MagicIdentifierLiteralExpr>(literal)
7319
- ->setBuiltinInitializer (builtinRef );
7301
+ ->setBuiltinInitializer (witness );
7320
7302
}
7321
7303
7322
7304
// The literal expression has this type.
@@ -7356,30 +7338,11 @@ Expr *ExprRewriter::convertLiteralInPlace(Expr *literal,
7356
7338
if (!witness || !isa<AbstractFunctionDecl>(witness.getDecl ()))
7357
7339
return nullptr ;
7358
7340
7359
- // Form a reference to the conversion function.
7360
- // FIXME: Bogus location info.
7361
- Expr *base = TypeExpr::createImplicitHack (literal->getLoc (), type,
7362
- tc.Context );
7363
-
7364
- Expr *unresolvedDot = new (tc.Context ) UnresolvedDotExpr (
7365
- base, SourceLoc (),
7366
- witness.getDecl ()->getFullName (),
7367
- DeclNameLoc (base->getEndLoc ()),
7368
- /* Implicit=*/ true );
7369
- (void )tc.typeCheckExpression (unresolvedDot, dc);
7370
- cs.cacheExprTypes (unresolvedDot);
7371
-
7372
- ConcreteDeclRef ref = unresolvedDot->getReferencedDecl ();
7373
- if (!ref) {
7374
- tc.diagnose (base->getLoc (), brokenProtocolDiag);
7375
- return nullptr ;
7376
- }
7377
-
7378
7341
// Set the initializer.
7379
7342
if (auto stringLiteral = dyn_cast<StringLiteralExpr>(literal))
7380
- stringLiteral->setInitializer (ref );
7343
+ stringLiteral->setInitializer (witness );
7381
7344
else
7382
- cast<MagicIdentifierLiteralExpr>(literal)->setInitializer (ref );
7345
+ cast<MagicIdentifierLiteralExpr>(literal)->setInitializer (witness );
7383
7346
7384
7347
// The literal expression has this type.
7385
7348
cs.setType (literal, type);
0 commit comments