Skip to content

Commit 360ca75

Browse files
authored
Merge pull request #23321 from slavapestov/old-sema-flag
Sema: Remove unused -fix-string-to-substring-conversion flag
2 parents ffd159a + 9626340 commit 360ca75

File tree

8 files changed

+0
-273
lines changed

8 files changed

+0
-273
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,6 @@ namespace swift {
274274
std::shared_ptr<llvm::Regex> OptimizationRemarkPassedPattern;
275275
std::shared_ptr<llvm::Regex> OptimizationRemarkMissedPattern;
276276

277-
/// When a conversion from String to Substring fails, emit a fix-it to append
278-
/// the void subscript '[]'.
279-
/// FIXME: Remove this flag when void subscripts are implemented.
280-
/// This is used to guard preemptive testing for the fix-it.
281-
bool FixStringToSubstringConversions = false;
282-
283277
/// Whether collect tokens during parsing for syntax coloring.
284278
bool CollectParsedToken = false;
285279

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,6 @@ def validate_tbd_against_ir_EQ: Joined<["-"], "validate-tbd-against-ir=">,
533533
HelpText<"Compare the symbols in the IR against the TBD file that would be generated.">,
534534
MetaVarName<"<level>">;
535535

536-
// FIXME: Remove this flag when void subscripts are implemented.
537-
// This is used to guard preemptive testing for the fix-it.
538-
def fix_string_substring_conversion: Flag<["-"], "fix-string-substring-conversion">,
539-
HelpText<"Emit a fix-it to append '[]' to String expressions when converting to Substring.">;
540-
541536
def bypass_batch_mode_checks: Flag<["-"], "bypass-batch-mode-checks">,
542537
HelpText<"Bypass checks for batch-mode errors.">;
543538

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
201201
const FrontendOptions &FrontendOpts) {
202202
using namespace options;
203203

204-
/// FIXME: Remove this flag when void subscripts are implemented.
205-
/// This is used to guard preemptive testing for the fix-it.
206-
if (Args.hasArg(OPT_fix_string_substring_conversion)) {
207-
Opts.FixStringToSubstringConversions = true;
208-
}
209-
210204
if (auto A = Args.getLastArg(OPT_swift_version)) {
211205
auto vers = version::Version::parseVersionString(
212206
A->getValue(), SourceLoc(), &Diags);

lib/Sema/CSDiagnostics.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,19 +1364,6 @@ bool ContextualFailure::trySequenceSubsequenceFixIts(InFlightDiagnostic &diag,
13641364
if (!String || !Substring)
13651365
return false;
13661366

1367-
/// FIXME: Remove this flag when void subscripts are implemented.
1368-
/// Make this unconditional and remove the if statement.
1369-
if (CS.TC.getLangOpts().FixStringToSubstringConversions) {
1370-
// String -> Substring conversion
1371-
// Add '[]' void subscript call to turn the whole String into a Substring
1372-
if (fromType->isEqual(String)) {
1373-
if (toType->isEqual(Substring)) {
1374-
diag.fixItInsertAfter(expr->getEndLoc(), "[]");
1375-
return true;
1376-
}
1377-
}
1378-
}
1379-
13801367
// Substring -> String conversion
13811368
// Wrap in String.init
13821369
if (fromType->isEqual(Substring)) {

test/Migrator/Inputs/string_to_substring_conversion.swift

Lines changed: 0 additions & 80 deletions
This file was deleted.

test/Migrator/string_to_substring_conversion.swift

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/Migrator/string_to_substring_conversion.swift.expected

Lines changed: 0 additions & 80 deletions
This file was deleted.

test/Sema/string_to_substring_conversion.swift

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)