mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user