@@ -92,7 +92,7 @@ static CanType unwrapExistential(CanType e) {
92
92
/// into an existential type by performing a static check
93
93
/// of protocol conformances if it is possible.
94
94
static DynamicCastFeasibility
95
- classifyDynamicCastToProtocol(ModuleDecl *M, CanType source, CanType target,
95
+ classifyDynamicCastToProtocol(CanType source, CanType target,
96
96
bool isWholeModuleOpts) {
97
97
assert(target.isExistentialType() &&
98
98
"target should be an existential type");
@@ -114,7 +114,7 @@ classifyDynamicCastToProtocol(ModuleDecl *M, CanType source, CanType target,
114
114
115
115
// If checkConformance() returns a valid conformance, then all conditional
116
116
// requirements were satisfied.
117
- if (M-> checkConformance(source, TargetProtocol))
117
+ if (ModuleDecl:: checkConformance(source, TargetProtocol))
118
118
return DynamicCastFeasibility::WillSucceed;
119
119
120
120
auto *SourceNominalTy = source.getAnyNominal();
@@ -152,7 +152,7 @@ classifyDynamicCastToProtocol(ModuleDecl *M, CanType source, CanType target,
152
152
// the checkConformance interface needs to be reformulated as a query, and
153
153
// the implementation, including checkGenericArguments, needs to be taught to
154
154
// recognize that types with archetypes may potentially succeed.
155
- if (auto conformance = M-> lookupConformance(source, TargetProtocol)) {
155
+ if (auto conformance = ModuleDecl:: lookupConformance(source, TargetProtocol)) {
156
156
assert(!conformance.getConditionalRequirements().empty());
157
157
return DynamicCastFeasibility::MaySucceed;
158
158
}
@@ -508,7 +508,7 @@ swift::classifyDynamicCast(ModuleDecl *M,
508
508
DynamicCastFeasibility::MaySucceed);
509
509
if (target.isExistentialType()) {
510
510
result = atWorst(result, classifyDynamicCastToProtocol(
511
- M, source, target, isWholeModuleOpts));
511
+ source, target, isWholeModuleOpts));
512
512
}
513
513
return result;
514
514
}
@@ -522,7 +522,7 @@ swift::classifyDynamicCast(ModuleDecl *M,
522
522
// Check conversions from non-protocol types into protocol types.
523
523
if (!source.isExistentialType() &&
524
524
target.isExistentialType())
525
- return classifyDynamicCastToProtocol(M, source, target,
525
+ return classifyDynamicCastToProtocol(source, target,
526
526
isWholeModuleOpts);
527
527
528
528
// Check conversions from protocol types to non-protocol types.
@@ -552,7 +552,7 @@ swift::classifyDynamicCast(ModuleDecl *M,
552
552
// Hashable is not actually a legal existential type right now, but
553
553
// the check doesn't care about that.
554
554
if (auto hashable = getHashableExistentialType(M)) {
555
- return classifyDynamicCastToProtocol(M, source, hashable,
555
+ return classifyDynamicCastToProtocol(source, hashable,
556
556
isWholeModuleOpts);
557
557
}
558
558
}
@@ -589,7 +589,7 @@ swift::classifyDynamicCast(ModuleDecl *M,
589
589
590
590
if (targetMetatype.isAnyExistentialType() && target->isExistentialType()) {
591
591
auto Feasibility =
592
- classifyDynamicCastToProtocol(M, source, target, isWholeModuleOpts);
592
+ classifyDynamicCastToProtocol(source, target, isWholeModuleOpts);
593
593
// Cast from existential metatype to existential metatype may still
594
594
// succeed, even if we cannot prove anything statically.
595
595
if (Feasibility != DynamicCastFeasibility::WillFail ||
0 commit comments