Skip to content

Commit f02a0f0

Browse files
committed
[NFC] Remove TypeChecker::getSubstringType
Inline it into its only caller
1 parent b6143c6 commit f02a0f0

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,10 +2571,7 @@ bool ContextualFailure::trySequenceSubsequenceFixIts(
25712571
return false;
25722572

25732573
auto String = TypeChecker::getStringType(getASTContext());
2574-
auto Substring = TypeChecker::getSubstringType(getASTContext());
2575-
2576-
if (!String || !Substring)
2577-
return false;
2574+
auto Substring = getASTContext().getSubstringDecl()->getDeclaredInterfaceType();
25782575

25792576
// Substring -> String conversion
25802577
// Wrap in String.init

lib/Sema/TypeCheckType.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,6 @@ Type TypeChecker::getStringType(ASTContext &Context) {
387387
return Type();
388388
}
389389

390-
Type TypeChecker::getSubstringType(ASTContext &Context) {
391-
if (auto typeDecl = Context.getSubstringDecl())
392-
return typeDecl->getDeclaredInterfaceType();
393-
394390
return Type();
395391
}
396392

0 commit comments

Comments
 (0)