Sema: Finish staging back in availability checking in synthesized functions

Remove the suppression of deprecation and potential unavailability diagnostics in
synthesized functions. We still suppress some explicit unavailability diagnostics -- those
in synthesized functions in synthesized functions that are lexically contained in
declarations that are themselves annotated as unavailable. For these cases, the right
solution <rdar://problem/20491640> is to not synthesize the bodies of these functions in
the first place.

rdar://problem/20024980

Swift SVN r27203
This commit is contained in:
Devin Coughlin
2015-04-10 05:19:04 +00:00
parent 6f1d4746dd
commit 53fd9fb59c
8 changed files with 23 additions and 46 deletions

View File

@@ -548,18 +548,6 @@ static bool diagAvailability(TypeChecker &TC, const ValueDecl *D,
if (!D)
return false;
// Suppress the error if the reference is inside an
// implicit function. This avoids spurious errors for synthesized
// methods (for example, for nil literal conformances of unavailable
// imported enums) but also erroneously allows some references
// to unavailable symbols (for example, a synthesized call to
// to an unavailable default constructor of a super class).
// We need to handle these properly. rdar://problem/20024980 tracks this.
if (!TC.getLangOpts().EnableAvailabilityCheckingInImplicitFunctions &&
TC.isInsideImplicitFunction(R, DC)) {
return false;
}
if (diagnoseExplicitUnavailability(TC, D, R, DC))
return true;