@@ -386,7 +386,6 @@ namespace {
386
386
// / Build a reference to the given declaration.
387
387
Expr *buildDeclRef (OverloadChoice choice, DeclNameLoc loc, Type openedType,
388
388
ConstraintLocatorBuilder locator, bool implicit,
389
- FunctionRefKind functionRefKind,
390
389
AccessSemantics semantics) {
391
390
assert (choice.getKind () != OverloadChoiceKind::DeclViaDynamic);
392
391
auto *decl = choice.getDecl ();
@@ -435,7 +434,7 @@ namespace {
435
434
} else {
436
435
auto declRefExpr = new (ctx) DeclRefExpr (witness, loc,
437
436
/* Implicit=*/ false );
438
- declRefExpr->setFunctionRefKind (functionRefKind );
437
+ declRefExpr->setFunctionRefKind (choice. getFunctionRefKind () );
439
438
refExpr = declRefExpr;
440
439
}
441
440
@@ -466,7 +465,7 @@ namespace {
466
465
467
466
return buildMemberRef (base, openedType, SourceLoc (), choice, loc,
468
467
openedFnType->getResult (), locator, locator,
469
- implicit, functionRefKind, semantics);
468
+ implicit, semantics);
470
469
}
471
470
472
471
auto type = solution.simplifyType (openedType);
@@ -483,7 +482,7 @@ namespace {
483
482
auto declRefExpr =
484
483
new (ctx) DeclRefExpr (ref, loc, implicit, semantics, type);
485
484
cs.cacheType (declRefExpr);
486
- declRefExpr->setFunctionRefKind (functionRefKind );
485
+ declRefExpr->setFunctionRefKind (choice. getFunctionRefKind () );
487
486
return forceUnwrapIfExpected (declRefExpr, choice, locator);
488
487
}
489
488
@@ -738,7 +737,6 @@ namespace {
738
737
OverloadChoice choice, DeclNameLoc memberLoc,
739
738
Type openedType, ConstraintLocatorBuilder locator,
740
739
ConstraintLocatorBuilder memberLocator, bool Implicit,
741
- FunctionRefKind functionRefKind,
742
740
AccessSemantics semantics) {
743
741
ValueDecl *member = choice.getDecl ();
744
742
@@ -770,7 +768,7 @@ namespace {
770
768
" Direct property access doesn't make sense for this" );
771
769
auto ref = new (context) DeclRefExpr (memberRef, memberLoc, Implicit);
772
770
cs.setType (ref, refTy);
773
- ref->setFunctionRefKind (functionRefKind );
771
+ ref->setFunctionRefKind (choice. getFunctionRefKind () );
774
772
auto *DSBI = cs.cacheType (new (context) DotSyntaxBaseIgnoredExpr (
775
773
base, dotLoc, ref, cs.getType (ref)));
776
774
return forceUnwrapIfExpected (DSBI, choice, memberLocator);
@@ -969,7 +967,7 @@ namespace {
969
967
// Handle all other references.
970
968
auto declRefExpr = new (context) DeclRefExpr (memberRef, memberLoc,
971
969
Implicit, semantics);
972
- declRefExpr->setFunctionRefKind (functionRefKind );
970
+ declRefExpr->setFunctionRefKind (choice. getFunctionRefKind () );
973
971
cs.setType (declRefExpr, refTy);
974
972
Expr *ref = declRefExpr;
975
973
@@ -2275,7 +2273,6 @@ namespace {
2275
2273
2276
2274
return buildDeclRef (selected->choice , expr->getNameLoc (),
2277
2275
selected->openedFullType , locator, expr->isImplicit (),
2278
- expr->getFunctionRefKind (),
2279
2276
expr->getAccessSemantics ());
2280
2277
}
2281
2278
@@ -2308,7 +2305,6 @@ namespace {
2308
2305
2309
2306
return buildDeclRef (choice, expr->getNameLoc (), selected.openedFullType ,
2310
2307
locator, expr->isImplicit (),
2311
- choice.getFunctionRefKind (),
2312
2308
AccessSemantics::Ordinary);
2313
2309
}
2314
2310
@@ -2331,7 +2327,7 @@ namespace {
2331
2327
expr->getBase (), selected.openedFullType , expr->getDotLoc (),
2332
2328
selected.choice , expr->getNameLoc (), selected.openedType ,
2333
2329
cs.getConstraintLocator (expr), memberLocator, expr->isImplicit (),
2334
- selected. choice . getFunctionRefKind (), expr->getAccessSemantics ());
2330
+ expr->getAccessSemantics ());
2335
2331
}
2336
2332
2337
2333
Expr *visitDynamicMemberRefExpr (DynamicMemberRefExpr *expr) {
@@ -2376,7 +2372,7 @@ namespace {
2376
2372
base, selected.openedFullType , expr->getDotLoc (), selected.choice ,
2377
2373
expr->getNameLoc (), selected.openedType ,
2378
2374
exprLoc, memberLocator, expr->isImplicit (),
2379
- selected. choice . getFunctionRefKind (), AccessSemantics::Ordinary);
2375
+ AccessSemantics::Ordinary);
2380
2376
if (!result)
2381
2377
return nullptr ;
2382
2378
@@ -2515,8 +2511,7 @@ namespace {
2515
2511
Expr *applyCtorRefExpr (Expr *expr, Expr *base, SourceLoc dotLoc,
2516
2512
DeclNameLoc nameLoc, bool implicit,
2517
2513
ConstraintLocator *ctorLocator,
2518
- OverloadChoice choice,
2519
- FunctionRefKind functionRefKind, Type openedType) {
2514
+ OverloadChoice choice, Type openedType) {
2520
2515
assert (choice.getKind () != OverloadChoiceKind::DeclViaDynamic);
2521
2516
auto *ctor = cast<ConstructorDecl>(choice.getDecl ());
2522
2517
@@ -2526,7 +2521,7 @@ namespace {
2526
2521
return buildMemberRef (
2527
2522
base, openedType, dotLoc, choice, nameLoc, cs.getType (expr),
2528
2523
ConstraintLocatorBuilder (cs.getConstraintLocator (expr)),
2529
- ctorLocator, implicit, functionRefKind, AccessSemantics::Ordinary);
2524
+ ctorLocator, implicit, AccessSemantics::Ordinary);
2530
2525
}
2531
2526
2532
2527
// The subexpression must be either 'self' or 'super'.
@@ -2590,7 +2585,7 @@ namespace {
2590
2585
auto choice = selected->choice ;
2591
2586
return applyCtorRefExpr (
2592
2587
expr, base, dotLoc, nameLoc, implicit, ctorLocator, choice,
2593
- choice. getFunctionRefKind (), selected->openedFullType );
2588
+ selected->openedFullType );
2594
2589
}
2595
2590
2596
2591
// Determine the declaration selected for this overloaded reference.
@@ -2620,7 +2615,6 @@ namespace {
2620
2615
2621
2616
return buildDeclRef (selected.choice , nameLoc, selected.openedFullType ,
2622
2617
memberLocator, implicit,
2623
- selected.choice .getFunctionRefKind (),
2624
2618
AccessSemantics::Ordinary);
2625
2619
}
2626
2620
@@ -2654,8 +2648,7 @@ namespace {
2654
2648
return buildMemberRef (base, selected.openedFullType , dotLoc,
2655
2649
selected.choice , nameLoc, selected.openedType ,
2656
2650
cs.getConstraintLocator (expr), memberLocator,
2657
- implicit, selected.choice .getFunctionRefKind (),
2658
- AccessSemantics::Ordinary);
2651
+ implicit, AccessSemantics::Ordinary);
2659
2652
2660
2653
case OverloadChoiceKind::TupleIndex: {
2661
2654
Type toType = simplifyType (cs.getType (expr));
@@ -6490,8 +6483,7 @@ static Expr *buildCallAsFunctionMethodRef(
6490
6483
auto *declRef = rewriter.buildMemberRef (
6491
6484
fn, selected.openedFullType , /* dotLoc*/ SourceLoc (), choice,
6492
6485
DeclNameLoc (fn->getEndLoc ()), selected.openedType , applyFunctionLoc,
6493
- applyFunctionLoc, /* implicit*/ true , choice.getFunctionRefKind (),
6494
- AccessSemantics::Ordinary);
6486
+ applyFunctionLoc, /* implicit*/ true , AccessSemantics::Ordinary);
6495
6487
if (!declRef)
6496
6488
return nullptr ;
6497
6489
declRef->setImplicit (apply->isImplicit ());
@@ -6527,7 +6519,6 @@ ExprRewriter::finishApplyDynamicCallable(ApplyExpr *apply,
6527
6519
SourceLoc (), selected.choice ,
6528
6520
DeclNameLoc (method->getNameLoc ()),
6529
6521
selected.openedType , loc, loc, /* implicit*/ true ,
6530
- selected.choice .getFunctionRefKind (),
6531
6522
AccessSemantics::Ordinary);
6532
6523
6533
6524
// Construct argument to the method (either an array or dictionary
@@ -6888,7 +6879,6 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, ConcreteDeclRef callee,
6888
6879
DeclNameLoc (fn->getEndLoc ()),
6889
6880
selected->openedType , locator, ctorLocator,
6890
6881
/* Implicit=*/ true ,
6891
- choice.getFunctionRefKind (),
6892
6882
AccessSemantics::Ordinary);
6893
6883
if (!declRef)
6894
6884
return nullptr ;
0 commit comments