mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user