Skip to content

Commit a29bfb4

Browse files
committed
Fold resolveImplicitConstructors into resolveImplicitMember
1 parent 572bc52 commit a29bfb4

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

include/swift/AST/LazyResolver.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ class LazyResolver {
5353
virtual void resolveWitness(const NormalProtocolConformance *conformance,
5454
ValueDecl *requirement) = 0;
5555

56-
/// Resolve any implicitly-declared constructors within the given nominal.
57-
virtual void resolveImplicitConstructors(NominalTypeDecl *nominal) = 0;
58-
5956
/// Resolve an implicitly-generated member with the given name.
6057
virtual void resolveImplicitMember(NominalTypeDecl *nominal, DeclName member) = 0;
6158
};

lib/AST/NameLookup.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,9 +1572,6 @@ bool DeclContext::lookupQualified(ArrayRef<NominalTypeDecl *> typeDecls,
15721572

15731573
// Make sure we've resolved implicit members, if we need them.
15741574
if (typeResolver) {
1575-
if (member.getBaseName() == DeclBaseName::createConstructor())
1576-
typeResolver->resolveImplicitConstructors(current);
1577-
15781575
typeResolver->resolveImplicitMember(current, member);
15791576
}
15801577

lib/Sema/CodeSynthesis.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,9 @@ void TypeChecker::synthesizeMemberForLookup(NominalTypeDecl *target,
10771077
DeclName member) {
10781078
auto baseName = member.getBaseName();
10791079

1080+
if (baseName == DeclBaseName::createConstructor())
1081+
addImplicitConstructors(target);
1082+
10801083
// Checks whether the target conforms to the given protocol. If the
10811084
// conformance is incomplete, force the conformance.
10821085
//

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ bool WitnessChecker::findBestWitness(
981981
bool anyFromUnconstrainedExtension;
982982
numViable = 0;
983983

984-
// FIXME: Remove dependnecy on the lazy resolver.
984+
// FIXME: Remove dependency on the lazy resolver.
985985
auto *TC = static_cast<TypeChecker *>(
986986
requirement->getASTContext().getLazyResolver());
987987
for (Attempt attempt = Regular; numViable == 0 && attempt != Done;
@@ -4537,7 +4537,7 @@ static void diagnosePotentialWitness(NormalProtocolConformance *conformance,
45374537
// Describe why the witness didn't satisfy the requirement.
45384538
WitnessChecker::RequirementEnvironmentCache oneUseCache;
45394539
auto dc = conformance->getDeclContext();
4540-
// FIXME: Remove dependnecy on the lazy resolver.
4540+
// FIXME: Remove dependency on the lazy resolver.
45414541
auto *TC = static_cast<TypeChecker *>(req->getASTContext().getLazyResolver());
45424542
auto match = matchWitness(*TC, oneUseCache, conformance->getProtocol(),
45434543
conformance, dc, req, witness);

0 commit comments

Comments
 (0)