@@ -43,7 +43,7 @@ bool ProtocolConformanceRef::isInvalid() const {
43
43
return false ;
44
44
}
45
45
46
- Type ProtocolConformanceRef::getConformingType () const {
46
+ Type ProtocolConformanceRef::getType () const {
47
47
if (isInvalid ())
48
48
return Type ();
49
49
@@ -53,16 +53,16 @@ Type ProtocolConformanceRef::getConformingType() const {
53
53
if (isPack ())
54
54
return Type (getPack ()->getType ());
55
55
56
- return getAbstract ()->getConformingType ();
56
+ return getAbstract ()->getType ();
57
57
}
58
58
59
- ProtocolDecl *ProtocolConformanceRef::getRequirement () const {
59
+ ProtocolDecl *ProtocolConformanceRef::getProtocol () const {
60
60
if (isConcrete ()) {
61
61
return getConcrete ()->getProtocol ();
62
62
} else if (isPack ()) {
63
63
return getPack ()->getProtocol ();
64
64
} else {
65
- return getAbstract ()->getRequirement ();
65
+ return getAbstract ()->getProtocol ();
66
66
}
67
67
}
68
68
@@ -107,7 +107,7 @@ ProtocolConformanceRef::subst(Type origType, InFlightSubstitution &IFS) const {
107
107
// Otherwise, compute the substituted type.
108
108
auto substType = origType.subst (IFS);
109
109
110
- auto *proto = getRequirement ();
110
+ auto *proto = getProtocol ();
111
111
112
112
// If the type is an existential, it must be self-conforming.
113
113
if (substType->isExistentialType ()) {
@@ -156,7 +156,7 @@ ProtocolConformanceRef::getTypeWitnessByName(Type type, Identifier name) const {
156
156
assert (!isInvalid ());
157
157
158
158
// Find the named requirement.
159
- ProtocolDecl *proto = getRequirement ();
159
+ ProtocolDecl *proto = getProtocol ();
160
160
auto *assocType = proto->getAssociatedType (name);
161
161
162
162
// FIXME: Shouldn't this be a hard error?
@@ -169,7 +169,7 @@ ProtocolConformanceRef::getTypeWitnessByName(Type type, Identifier name) const {
169
169
ConcreteDeclRef
170
170
ProtocolConformanceRef::getWitnessByName (Type type, DeclName name) const {
171
171
// Find the named requirement.
172
- auto *proto = getRequirement ();
172
+ auto *proto = getProtocol ();
173
173
auto *requirement = proto->getSingleRequirement (name);
174
174
if (requirement == nullptr )
175
175
return ConcreteDeclRef ();
@@ -210,7 +210,7 @@ Type ProtocolConformanceRef::getTypeWitness(Type conformingType,
210
210
if (isInvalid ())
211
211
return failed ();
212
212
213
- auto proto = getRequirement ();
213
+ auto proto = getProtocol ();
214
214
ASSERT (assocType->getProtocol () == proto);
215
215
216
216
if (isConcrete ()) {
@@ -239,7 +239,7 @@ Type ProtocolConformanceRef::getAssociatedType(Type conformingType,
239
239
if (isInvalid ())
240
240
return ErrorType::get (assocType->getASTContext ());
241
241
242
- auto proto = getRequirement ();
242
+ auto proto = getProtocol ();
243
243
244
244
auto substMap =
245
245
SubstitutionMap::getProtocolSubstitutions (proto, conformingType, *this );
@@ -313,7 +313,7 @@ bool ProtocolConformanceRef::isCanonical() const {
313
313
return getPack ()->isCanonical ();
314
314
315
315
if (isAbstract ()) {
316
- Type conformingType = getConformingType ();
316
+ Type conformingType = getType ();
317
317
return !conformingType || conformingType->isCanonical ();
318
318
}
319
319
@@ -329,10 +329,10 @@ ProtocolConformanceRef::getCanonicalConformanceRef() const {
329
329
return ProtocolConformanceRef (getPack ()->getCanonicalConformance ());
330
330
331
331
if (isAbstract ()) {
332
- Type conformingType = getConformingType ();
332
+ Type conformingType = getType ();
333
333
if (conformingType)
334
334
conformingType = conformingType->getCanonicalType ();
335
- return forAbstract (conformingType, getRequirement ());
335
+ return forAbstract (conformingType, getProtocol ());
336
336
}
337
337
338
338
return ProtocolConformanceRef (getConcrete ()->getCanonicalConformance ());
@@ -445,7 +445,7 @@ bool ProtocolConformanceRef::forEachIsolatedConformance(
445
445
446
446
void swift::simple_display (llvm::raw_ostream &out, ProtocolConformanceRef conformanceRef) {
447
447
if (conformanceRef.isAbstract ()) {
448
- simple_display (out, conformanceRef.getRequirement ());
448
+ simple_display (out, conformanceRef.getProtocol ());
449
449
} else if (conformanceRef.isConcrete ()) {
450
450
simple_display (out, conformanceRef.getConcrete ());
451
451
} else if (conformanceRef.isPack ()) {
@@ -455,7 +455,7 @@ void swift::simple_display(llvm::raw_ostream &out, ProtocolConformanceRef confor
455
455
456
456
SourceLoc swift::extractNearestSourceLoc (const ProtocolConformanceRef conformanceRef) {
457
457
if (conformanceRef.isAbstract ()) {
458
- return extractNearestSourceLoc (conformanceRef.getRequirement ());
458
+ return extractNearestSourceLoc (conformanceRef.getProtocol ());
459
459
} else if (conformanceRef.isConcrete ()) {
460
460
return extractNearestSourceLoc (conformanceRef.getConcrete ());
461
461
}
0 commit comments