Clean up the interface to Type::subst(), NFC.

Replace the 'ignoreMissing' boolean flag with a new option set type,
SubstOptions, which is easier to extend. It is not an OptionSet<>
because a follow-on commit will introduce a non-trivial option that
will require more storage.

Also eliminate the LazyResolver parameter, which is no longer
needed. Eliminate the silly TypeChecker::substType(), whose only
purpose was to provide the resolver.

Swift SVN r27656
This commit is contained in:
Doug Gregor
2015-04-23 23:36:18 +00:00
parent 4b5a28217e
commit 02d25888c9
16 changed files with 104 additions and 102 deletions

View File

@@ -691,9 +691,10 @@ ArrayRef<Substitution> BoundGenericType::getSubstitutions(
index = 0;
for (auto archetype : allArchetypes) {
// Substitute into the type.
auto type = Type(archetype).subst(module, substitutions,
/*ignoreMissing=*/hasTypeVariables,
resolver);
SubstOptions options;
if (hasTypeVariables)
options |= SubstOptions::IgnoreMissing;
auto type = Type(archetype).subst(module, substitutions, options);
if (!type)
type = ErrorType::get(module->getASTContext());