@@ -5909,17 +5909,15 @@ bool TypeChecker::isAvailabilitySafeForOverride(ValueDecl *override,
5909
5909
}
5910
5910
5911
5911
bool TypeChecker::isAvailabilitySafeForConformance (
5912
- ValueDecl *witness, ValueDecl *requirement,
5913
- NormalProtocolConformance *conformance,
5914
- AvailabilityContext &requirementInfo) {
5915
- DeclContext *DC = conformance->getDeclContext ();
5912
+ ProtocolDecl *proto, ValueDecl *requirement, ValueDecl *witness,
5913
+ DeclContext *dc, AvailabilityContext &requirementInfo) {
5916
5914
5917
5915
// We assume conformances in
5918
5916
// non-SourceFiles have already been checked for availability.
5919
- if (!DC ->getParentSourceFile ())
5917
+ if (!dc ->getParentSourceFile ())
5920
5918
return true ;
5921
5919
5922
- NominalTypeDecl *conformingDecl = DC ->getAsNominalTypeOrNominalTypeExtensionContext ();
5920
+ NominalTypeDecl *conformingDecl = dc ->getAsNominalTypeOrNominalTypeExtensionContext ();
5923
5921
assert (conformingDecl && " Must have conforming declaration" );
5924
5922
5925
5923
// Make sure that any access of the witness through the protocol
@@ -5944,10 +5942,8 @@ bool TypeChecker::isAvailabilitySafeForConformance(
5944
5942
witnessInfo.constrainWith (infoForConformingDecl);
5945
5943
requirementInfo.constrainWith (infoForConformingDecl);
5946
5944
5947
- ProtocolDecl *protocolDecl = conformance->getProtocol ();
5948
5945
AvailabilityContext infoForProtocolDecl =
5949
- overApproximateAvailabilityAtLocation (protocolDecl->getLoc (),
5950
- protocolDecl);
5946
+ overApproximateAvailabilityAtLocation (proto->getLoc (), proto);
5951
5947
5952
5948
witnessInfo.constrainWith (infoForProtocolDecl);
5953
5949
requirementInfo.constrainWith (infoForProtocolDecl);
0 commit comments