Re-organize the checking of @IBOutlet to better handle implicit optionalification.

Swift SVN r16201
This commit is contained in:
Doug Gregor
2014-04-11 06:09:03 +00:00
parent b285190383
commit fa6ae94e0e
7 changed files with 107 additions and 39 deletions

View File

@@ -725,6 +725,14 @@ bool PatternBindingDecl::hasStorage() const {
return HasStorage;
}
VarDecl *PatternBindingDecl::getSingleVar() const {
auto pattern = getPattern()->getSemanticsProvidingPattern();
if (auto named = dyn_cast<NamedPattern>(pattern))
return named->getDecl();
return nullptr;
}
SourceLoc TopLevelCodeDecl::getStartLoc() const {
return Body->getStartLoc();
}