Skip to content

Sema: Remove unused -fix-string-to-substring-conversion flag #23321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,6 @@ namespace swift {
std::shared_ptr<llvm::Regex> OptimizationRemarkPassedPattern;
std::shared_ptr<llvm::Regex> OptimizationRemarkMissedPattern;

/// When a conversion from String to Substring fails, emit a fix-it to append
/// the void subscript '[]'.
/// FIXME: Remove this flag when void subscripts are implemented.
/// This is used to guard preemptive testing for the fix-it.
bool FixStringToSubstringConversions = false;

/// Whether collect tokens during parsing for syntax coloring.
bool CollectParsedToken = false;

Expand Down
5 changes: 0 additions & 5 deletions include/swift/Option/FrontendOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,6 @@ def validate_tbd_against_ir_EQ: Joined<["-"], "validate-tbd-against-ir=">,
HelpText<"Compare the symbols in the IR against the TBD file that would be generated.">,
MetaVarName<"<level>">;

// FIXME: Remove this flag when void subscripts are implemented.
// This is used to guard preemptive testing for the fix-it.
def fix_string_substring_conversion: Flag<["-"], "fix-string-substring-conversion">,
HelpText<"Emit a fix-it to append '[]' to String expressions when converting to Substring.">;

def bypass_batch_mode_checks: Flag<["-"], "bypass-batch-mode-checks">,
HelpText<"Bypass checks for batch-mode errors.">;

Expand Down
6 changes: 0 additions & 6 deletions lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
const FrontendOptions &FrontendOpts) {
using namespace options;

/// FIXME: Remove this flag when void subscripts are implemented.
/// This is used to guard preemptive testing for the fix-it.
if (Args.hasArg(OPT_fix_string_substring_conversion)) {
Opts.FixStringToSubstringConversions = true;
}

if (auto A = Args.getLastArg(OPT_swift_version)) {
auto vers = version::Version::parseVersionString(
A->getValue(), SourceLoc(), &Diags);
Expand Down
13 changes: 0 additions & 13 deletions lib/Sema/CSDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1364,19 +1364,6 @@ bool ContextualFailure::trySequenceSubsequenceFixIts(InFlightDiagnostic &diag,
if (!String || !Substring)
return false;

/// FIXME: Remove this flag when void subscripts are implemented.
/// Make this unconditional and remove the if statement.
if (CS.TC.getLangOpts().FixStringToSubstringConversions) {
// String -> Substring conversion
// Add '[]' void subscript call to turn the whole String into a Substring
if (fromType->isEqual(String)) {
if (toType->isEqual(Substring)) {
diag.fixItInsertAfter(expr->getEndLoc(), "[]");
return true;
}
}
}

// Substring -> String conversion
// Wrap in String.init
if (fromType->isEqual(Substring)) {
Expand Down
80 changes: 0 additions & 80 deletions test/Migrator/Inputs/string_to_substring_conversion.swift

This file was deleted.

3 changes: 0 additions & 3 deletions test/Migrator/string_to_substring_conversion.swift

This file was deleted.

80 changes: 0 additions & 80 deletions test/Migrator/string_to_substring_conversion.swift.expected

This file was deleted.

80 changes: 0 additions & 80 deletions test/Sema/string_to_substring_conversion.swift

This file was deleted.