@@ -85,16 +85,13 @@ RequirementEnvironment::RequirementEnvironment(
85
85
// parameters of the requirement into a combined context that provides the
86
86
// type parameters of the conformance context and the parameters of the
87
87
// requirement.
88
- auto selfType = cast<GenericTypeParamType>(
89
- proto->getSelfInterfaceType ()->getCanonicalType ());
90
-
91
88
reqToWitnessThunkSigMap = SubstitutionMap::get (reqSig,
92
- [selfType, substConcreteType, depth, covariantSelf, &ctx]
89
+ [substConcreteType, depth, covariantSelf, &ctx]
93
90
(SubstitutableType *type) -> Type {
94
91
// If the conforming type is a class, the protocol 'Self' maps to
95
92
// the class-constrained 'Self'. Otherwise, it maps to the concrete
96
93
// type.
97
- if (type->isEqual (selfType )) {
94
+ if (type->isEqual (ctx. TheSelfType )) {
98
95
if (covariantSelf)
99
96
return ctx.TheSelfType ;
100
97
return substConcreteType;
@@ -114,11 +111,11 @@ RequirementEnvironment::RequirementEnvironment(
114
111
}
115
112
return substGenericParam;
116
113
},
117
- [selfType, substConcreteType, conformance, conformanceDC, covariantSelf, &ctx](
114
+ [substConcreteType, conformance, conformanceDC, covariantSelf, &ctx](
118
115
CanType type, Type replacement, ProtocolDecl *proto)
119
116
-> ProtocolConformanceRef {
120
117
// The protocol 'Self' conforms concretely to the conforming type.
121
- if (type->isEqual (selfType )) {
118
+ if (type->isEqual (ctx. TheSelfType )) {
122
119
ASSERT (covariantSelf || replacement->isEqual (substConcreteType));
123
120
124
121
if (conformance) {
0 commit comments