Skip to content

Commit 1e9ae59

Browse files
authored
Merge pull request swiftlang#36681 from xedin/revert-implicit-conversion-flag
Revert "[TypeChecker] Add a flag to disable Double<->CGFloat implicit…
2 parents c03c3b2 + ed8491c commit 1e9ae59

File tree

6 files changed

+0
-20
lines changed

6 files changed

+0
-20
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,6 @@ namespace swift {
589589

590590
/// See \ref FrontendOptions.PrintFullConvention
591591
bool PrintFullConvention = false;
592-
593-
/// Disallow Double and CGFloat types from being used interchangeably.
594-
bool DisableImplicitDoubleCGFloatConversion = false;
595592
};
596593

597594
/// Options for controlling the behavior of the Clang importer.

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ def enable_resilience : Flag<["-"], "enable-resilience">,
244244
// HIDDEN FLAGS
245245
let Flags = [FrontendOption, NoDriverOption, HelpHidden] in {
246246

247-
def disable_implicit_double_cgfloat_conversion : Flag<["-"], "disable-implicit-double-cgfloat-conversion">,
248-
HelpText<"Disable implicit conversion between Double and CGFloat types">;
249-
250247
def debug_constraints : Flag<["-"], "debug-constraints">,
251248
HelpText<"Debug the constraint-based type checker">;
252249

include/swift/Sema/ConstraintSystem.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,10 +1405,6 @@ enum class ConstraintSystemFlags {
14051405
/// calling conventions, say due to Clang attributes such as
14061406
/// `__attribute__((ns_consumed))`.
14071407
UseClangFunctionTypes = 0x80,
1408-
1409-
/// Disallow using Double and CGFloat interchangeably by means of
1410-
/// an implicit value conversion.
1411-
DisableImplicitDoubleCGFloatConversion = 0x100,
14121408
};
14131409

14141410
/// Options that affect the constraint system as a whole.

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,9 +827,6 @@ static bool ParseTypeCheckerArgs(TypeCheckerOptions &Opts, ArgList &Args,
827827
Opts.DebugConstraintSolver |= Args.hasArg(OPT_debug_constraints);
828828
Opts.DebugGenericSignatures |= Args.hasArg(OPT_debug_generic_signatures);
829829

830-
Opts.DisableImplicitDoubleCGFloatConversion |=
831-
Args.hasArg(OPT_disable_implicit_double_cgfloat_conversion);
832-
833830
for (const Arg *A : Args.filtered(OPT_debug_constraints_on_line)) {
834831
unsigned line;
835832
if (StringRef(A->getValue()).getAsInteger(/*radix*/ 10, line)) {

lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5131,10 +5131,6 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
51315131
nominal1->getDecl() != nominal2->getDecl() &&
51325132
((nominal1->isCGFloatType() || nominal2->isCGFloatType()) &&
51335133
(nominal1->isDoubleType() || nominal2->isDoubleType()))) {
5134-
if (Options.contains(
5135-
ConstraintSystemFlags::DisableImplicitDoubleCGFloatConversion))
5136-
return getTypeMatchFailure(locator);
5137-
51385134
// Support implicit Double<->CGFloat conversions only for
51395135
// something which could be directly represented in the AST
51405136
// e.g. argument-to-parameter, contextual conversions etc.

lib/Sema/ConstraintSystem.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ ConstraintSystem::ConstraintSystem(DeclContext *dc,
8888
}
8989
if (Context.LangOpts.UseClangFunctionTypes)
9090
Options |= ConstraintSystemFlags::UseClangFunctionTypes;
91-
92-
if (Context.TypeCheckerOpts.DisableImplicitDoubleCGFloatConversion)
93-
Options |= ConstraintSystemFlags::DisableImplicitDoubleCGFloatConversion;
9491
}
9592

9693
ConstraintSystem::~ConstraintSystem() {

0 commit comments

Comments
 (0)