ClangImporter: More principled use of mapType{Into,OutOf}Context()

Before we would construct types containing a mix of interface and
contextual types, and then map them in and out. Straighten this out.

Note that I've also had to start untangling the issue where
synthesized ParamDecls do not have an interface type.
This commit is contained in:
Slava Pestov
2016-06-25 07:46:15 -07:00
parent c684ad2a8c
commit 584eda38ed
7 changed files with 175 additions and 179 deletions

View File

@@ -2106,6 +2106,7 @@ swift::createDesignatedInitOverride(TypeChecker &tc,
// Apply the superclass substitutions to produce an interface
// type in terms of the class generic signature.
auto paramSubstTy = paramTy.subst(moduleDecl, subsMap, SubstOptions());
decl->setInterfaceType(paramSubstTy);
// Map it to a contextual type in terms of the class's archetypes.
decl->overwriteType(ArchetypeBuilder::mapTypeIntoContext(