Add handling of potentially unavailable overloaded global functions to Sema.

This commit also factors out some common checking and diagnostic code; it
additionally moves diagnostic emission for unavailable references from CSGen to
CSApply.


Swift SVN r22447
This commit is contained in:
Devin Coughlin
2014-10-01 23:52:08 +00:00
parent 3a606b9eb8
commit 2e8d4bc718
7 changed files with 144 additions and 49 deletions

View File

@@ -3462,6 +3462,9 @@ Type ConstraintSystem::getBaseTypeForArrayType(TypeBase *type) {
}
Type ConstraintSystem::getTypeWhenUnavailable(Type declType) {
if (!TC.getLangOpts().EnableExperimentalUnavailableAsOptional) {
return declType;
}
// Drop lvalue-ness and make optional.
return OptionalType::get(declType->getRValueType());
}