mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Remove experimental support for treating unavailable symbols as optional.
This has always been off by default and is a language direction we have decided not to pursue. Swift SVN r30355
This commit is contained in:
@@ -2934,16 +2934,14 @@ ConstraintSystem::simplifyMemberConstraint(const Constraint &constraint) {
|
||||
|
||||
if (argType->isEqual(favoredType)) {
|
||||
favoredChoice = OverloadChoice(baseTy, constructor,
|
||||
/*isSpecialized=*/false, *this,
|
||||
unavailReason);
|
||||
/*isSpecialized=*/false, *this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
choices.push_back(OverloadChoice(baseTy, constructor,
|
||||
/*isSpecialized=*/false, *this,
|
||||
unavailReason));
|
||||
/*isSpecialized=*/false, *this));
|
||||
}
|
||||
|
||||
|
||||
@@ -3238,12 +3236,8 @@ ConstraintSystem::simplifyMemberConstraint(const Constraint &constraint) {
|
||||
choices.push_back(OverloadChoice::getDeclViaUnwrappedOptional(ovlBaseTy,
|
||||
result));
|
||||
} else {
|
||||
SourceLoc anchorLoc = constraint.getLocator()->getAnchor()->getLoc();
|
||||
auto unavailReason = TC.checkDeclarationAvailability(result, anchorLoc,
|
||||
DC);
|
||||
choices.push_back(OverloadChoice(ovlBaseTy, result,
|
||||
/*isSpecialized=*/false, *this,
|
||||
unavailReason));
|
||||
/*isSpecialized=*/false, *this));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3683,14 +3677,6 @@ Type ConstraintSystem::getBaseTypeForSetType(TypeBase *type) {
|
||||
llvm_unreachable("attempted to extract a base type from a non-set type");
|
||||
}
|
||||
|
||||
Type ConstraintSystem::getTypeWhenUnavailable(Type declType) {
|
||||
if (!TC.getLangOpts().EnableExperimentalUnavailableAsOptional) {
|
||||
return declType;
|
||||
}
|
||||
// Drop lvalue-ness and make optional.
|
||||
return OptionalType::get(declType->getRValueType());
|
||||
}
|
||||
|
||||
static Type getBaseTypeForPointer(ConstraintSystem &cs, TypeBase *type) {
|
||||
auto bgt = type->castTo<BoundGenericType>();
|
||||
assert((bgt->getDecl() == cs.getASTContext().getUnsafeMutablePointerDecl()
|
||||
|
||||
Reference in New Issue
Block a user