Skip to content

Commit f4a3a65

Browse files
committed
Fix: Adjust the declaration positions of writtenBase and correctedBase
1 parent 022af38 commit f4a3a65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Sema/TypeCheckNameLookup.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,16 +548,16 @@ unsigned TypeChecker::getCallEditDistance(DeclNameRef writtenName,
548548
return 0;
549549
}
550550

551-
StringRef writtenBase = writtenName.getBaseName().userFacingName();
552-
StringRef correctedBase = correctedName.getBaseName().userFacingName();
553-
554551
// Don't typo-correct to a name with a leading underscore unless the typed
555552
// name also begins with an underscore.
556553
if (correctedName.getBaseIdentifier().hasUnderscoredNaming() &&
557554
!writtenName.getBaseIdentifier().hasUnderscoredNaming()) {
558555
return UnreasonableCallEditDistance;
559556
}
560557

558+
StringRef writtenBase = writtenName.getBaseName().userFacingName();
559+
StringRef correctedBase = correctedName.getBaseName().userFacingName();
560+
561561
unsigned distance = writtenBase.edit_distance(correctedBase, maxEditDistance);
562562

563563
// Bound the distance to UnreasonableCallEditDistance.

0 commit comments

Comments
 (0)