@@ -2068,7 +2068,7 @@ void TypeChecker::diagnosePotentialUnavailability(
20682068 {
20692069 auto Err = Context.Diags .diagnose (
20702070 ReferenceRange.Start , Diag,
2071- prettyPlatformString ( targetPlatform ( Context.LangOpts ) ),
2071+ Context.getTargetPlatformStringForDiagnostics ( ),
20722072 Availability.getRawMinimumVersion ());
20732073
20742074 // Direct a fixit to the error if an existing guard is nearly-correct
@@ -2122,7 +2122,7 @@ static Diagnostic getPotentialUnavailabilityDiagnostic(
21222122 const AvailabilityContext &Availability, bool WarnBeforeDeploymentTarget,
21232123 bool &IsError) {
21242124 ASTContext &Context = ReferenceDC->getASTContext ();
2125- auto Platform = prettyPlatformString ( targetPlatform ( Context.LangOpts ) );
2125+ auto Platform = Context.getTargetPlatformStringForDiagnostics ( );
21262126
21272127 if (requiresDeploymentTargetOrEarlier (Availability, Context)) {
21282128 // The required OS version is at or before the deployment target so this
@@ -2179,7 +2179,7 @@ void TypeChecker::diagnosePotentialAccessorUnavailability(
21792179 {
21802180 auto Err = Context.Diags .diagnose (
21812181 ReferenceRange.Start , diag, Accessor,
2182- prettyPlatformString ( targetPlatform ( Context.LangOpts ) ),
2182+ Context.getTargetPlatformStringForDiagnostics ( ),
21832183 Availability.getRawMinimumVersion ());
21842184
21852185 // Direct a fixit to the error if an existing guard is nearly-correct
@@ -2221,7 +2221,7 @@ void TypeChecker::diagnosePotentialUnavailability(
22212221 auto proto = rootConf->getProtocol ()->getDeclaredInterfaceType ();
22222222 auto err = ctx.Diags .diagnose (
22232223 loc, diag::conformance_availability_only_version_newer, type, proto,
2224- prettyPlatformString ( targetPlatform ( ctx.LangOpts ) ),
2224+ ctx.getTargetPlatformStringForDiagnostics ( ),
22252225 availability.getRawMinimumVersion ());
22262226
22272227 err.warnUntilSwiftVersion (6 );
0 commit comments