@@ -655,7 +655,7 @@ Expr *TypeChecker::resolveDeclRefExpr(UnresolvedDeclRefExpr *UDRE,
655
655
D->getInterfaceType ());
656
656
}
657
657
658
- return TypeExpr::createForDecl (Loc , D,
658
+ return TypeExpr::createForDecl (UDRE-> getNameLoc () , D,
659
659
Lookup[0 ].getDeclContext (),
660
660
UDRE->isImplicit ());
661
661
}
@@ -747,12 +747,13 @@ Expr *TypeChecker::resolveDeclRefExpr(UnresolvedDeclRefExpr *UDRE,
747
747
if (AllMemberRefs) {
748
748
Expr *BaseExpr;
749
749
if (auto PD = dyn_cast<ProtocolDecl>(Base)) {
750
- BaseExpr = TypeExpr::createForDecl (Loc ,
750
+ BaseExpr = TypeExpr::createForDecl (UDRE-> getNameLoc () ,
751
751
PD->getGenericParams ()->getParams ().front (),
752
752
/* DC*/ nullptr ,
753
753
/* isImplicit=*/ true );
754
754
} else if (auto NTD = dyn_cast<NominalTypeDecl>(Base)) {
755
- BaseExpr = TypeExpr::createForDecl (Loc, NTD, BaseDC, /* isImplicit=*/ true );
755
+ BaseExpr = TypeExpr::createForDecl (UDRE->getNameLoc (), NTD, BaseDC,
756
+ /* isImplicit=*/ true );
756
757
} else {
757
758
BaseExpr = new (Context) DeclRefExpr (Base, UDRE->getNameLoc (),
758
759
/* Implicit=*/ true );
@@ -1416,9 +1417,8 @@ TypeExpr *PreCheckExpression::simplifyNestedTypeExpr(UnresolvedDotExpr *UDE) {
1416
1417
// If there is no nested type with this name, we have a lookup of
1417
1418
// a non-type member, so leave the expression as-is.
1418
1419
if (Result.size () == 1 ) {
1419
- return TypeExpr::createForMemberDecl (DRE->getNameLoc ().getBaseNameLoc (),
1420
- TD, NameLoc,
1421
- Result.front ().Member );
1420
+ return TypeExpr::createForMemberDecl (
1421
+ DRE->getNameLoc (), TD, UDE->getNameLoc (), Result.front ().Member );
1422
1422
}
1423
1423
}
1424
1424
@@ -1472,7 +1472,7 @@ TypeExpr *PreCheckExpression::simplifyNestedTypeExpr(UnresolvedDotExpr *UDE) {
1472
1472
// If there is no nested type with this name, we have a lookup of
1473
1473
// a non-type member, so leave the expression as-is.
1474
1474
if (Result.size () == 1 ) {
1475
- return TypeExpr::createForMemberDecl (ITR, NameLoc ,
1475
+ return TypeExpr::createForMemberDecl (ITR, UDE-> getNameLoc () ,
1476
1476
Result.front ().Member );
1477
1477
}
1478
1478
}
0 commit comments