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

@@ -1390,17 +1390,6 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
= getTypeOfReference(choice.getDecl(), isTypeReference,
choice.isSpecialized(), locator);
}
if (choice.isPotentiallyUnavailable()) {
// For the moment, we do not treat constructors as optional
// when potentially unavailable, even when
// ExperimentalEnableUnavailableAsOptional is turned on.
if (choice.getDecl()->getKind() != DeclKind::Constructor) {
// Strip lvalue-ness and make type optional to reflect fact
// that declaration may not be available.
refType = getTypeWhenUnavailable(refType);
}
}
if (choice.getDecl()->getAttrs().hasAttribute<OptionalAttr>() &&
!isa<SubscriptDecl>(choice.getDecl())) {