Move the resolution of extension types, operator declarations, and superclasses into the type checker.

This eliminates the duplicate IdentifierType resolution code (fixing
<rdar://problem/13946567>), and moves us a step closure to elimining
name binding as a separate pass.


Swift SVN r5940
This commit is contained in:
Doug Gregor
2013-07-01 18:38:05 +00:00
parent f67ca6ae35
commit bcf41bbc3f
6 changed files with 122 additions and 333 deletions

View File

@@ -674,8 +674,12 @@ Type FuncDecl::getExtensionType() const {
case DeclContextKind::NominalTypeDecl:
return cast<NominalTypeDecl>(DC)->getDeclaredType();
case DeclContextKind::ExtensionDecl:
return cast<ExtensionDecl>(DC)->getExtendedType();
case DeclContextKind::ExtensionDecl: {
auto ext = cast<ExtensionDecl>(DC);
if (ext->isInvalid())
return ErrorType::get(getASTContext());
return ext->getExtendedType();
}
}
llvm_unreachable("bad context kind");
}