Skip to content

Commit da95db4

Browse files
committed
Make deriveProtocolRequirement a static utility
1 parent 89b81a2 commit da95db4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3358,7 +3358,8 @@ ResolveWitnessResult ConformanceChecker::resolveWitnessViaDerivation(
33583358
}
33593359

33603360
// Attempt to derive the witness.
3361-
auto derived = TC.deriveProtocolRequirement(DC, derivingTypeDecl, requirement);
3361+
auto derived =
3362+
TypeChecker::deriveProtocolRequirement(DC, derivingTypeDecl, requirement);
33623363
if (!derived)
33633364
return ResolveWitnessResult::ExplicitFailed;
33643365

lib/Sema/TypeChecker.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,9 +1550,9 @@ class TypeChecker final : public LazyResolver {
15501550
/// \returns nullptr if the derivation failed, or the derived declaration
15511551
/// if it succeeded. If successful, the derived declaration is added
15521552
/// to TypeDecl's body.
1553-
ValueDecl *deriveProtocolRequirement(DeclContext *DC,
1554-
NominalTypeDecl *TypeDecl,
1555-
ValueDecl *Requirement);
1553+
static ValueDecl *deriveProtocolRequirement(DeclContext *DC,
1554+
NominalTypeDecl *TypeDecl,
1555+
ValueDecl *Requirement);
15561556

15571557
/// Derive an implicit type witness for the given associated type in
15581558
/// the conformance of the given nominal type to some known

0 commit comments

Comments
 (0)