Revert "Turn on ‘as’ bridging on Linux."

This commit is contained in:
Ben Langmuir
2018-05-17 14:54:35 -07:00
committed by GitHub
parent 6e5605aee8
commit 628b6a1fc7
15 changed files with 111 additions and 324 deletions

View File

@@ -3627,6 +3627,11 @@ ConstraintSystem::simplifyBridgingConstraint(Type type1,
Type type2,
TypeMatchOptions flags,
ConstraintLocatorBuilder locator) {
// There's no bridging without ObjC interop, so we shouldn't have set up
// bridging constraints without it.
assert(TC.Context.LangOpts.EnableObjCInterop
&& "bridging constraint w/o ObjC interop?!");
TypeMatchOptions subflags = getDefaultDecompositionOptions(flags);
/// Form an unresolved result.
@@ -5071,11 +5076,14 @@ void ConstraintSystem::addExplicitConversionConstraint(
coerceConstraint->setFavored();
constraints.push_back(coerceConstraint);
// The source type can be explicitly converted to the destination type.
Constraint *bridgingConstraint =
Constraint::create(*this, ConstraintKind::BridgingConversion,
fromType, toType, locatorPtr);
constraints.push_back(bridgingConstraint);
// Bridging.
if (getASTContext().LangOpts.EnableObjCInterop) {
// The source type can be explicitly converted to the destination type.
Constraint *bridgingConstraint =
Constraint::create(*this, ConstraintKind::BridgingConversion,
fromType, toType, locatorPtr);
constraints.push_back(bridgingConstraint);
}
if (allowFixes && shouldAttemptFixes()) {
Constraint *downcastConstraint =
@@ -5086,8 +5094,8 @@ void ConstraintSystem::addExplicitConversionConstraint(
}
addDisjunctionConstraint(constraints, locator,
allowFixes ? RememberChoice
: ForgetChoice);
getASTContext().LangOpts.EnableObjCInterop && allowFixes ? RememberChoice
: ForgetChoice);
}
ConstraintSystem::SolutionKind