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:
Devin Coughlin
2015-07-18 01:56:25 +00:00
parent 4f6bedfc51
commit c1caddae62
19 changed files with 30 additions and 740 deletions

View File

@@ -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()