File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -575,6 +575,14 @@ namespace swift {
575575 return limitBehavior (limit);
576576 }
577577
578+ // / Limit the diagnostic behavior to \c limit until the specified
579+ // / version.
580+ // /
581+ // / This helps stage in fixes for stricter diagnostics as warnings
582+ // / until the next major language version.
583+ InFlightDiagnostic &limitBehaviorUntilSwiftVersion (
584+ DiagnosticBehavior limit, unsigned majorVersion);
585+
578586 // / Limit the diagnostic behavior to warning until the specified version.
579587 // /
580588 // / This helps stage in fixes for stricter diagnostics as warnings
Original file line number Diff line number Diff line change @@ -328,9 +328,10 @@ InFlightDiagnostic::limitBehavior(DiagnosticBehavior limit) {
328328}
329329
330330InFlightDiagnostic &
331- InFlightDiagnostic::warnUntilSwiftVersion (unsigned majorVersion) {
331+ InFlightDiagnostic::limitBehaviorUntilSwiftVersion (
332+ DiagnosticBehavior limit, unsigned majorVersion) {
332333 if (!Engine->languageVersion .isVersionAtLeast (majorVersion)) {
333- limitBehavior (DiagnosticBehavior::Warning )
334+ limitBehavior (limit )
334335 .wrapIn (diag::error_in_future_swift_version, majorVersion);
335336 }
336337
@@ -343,6 +344,12 @@ InFlightDiagnostic::warnUntilSwiftVersion(unsigned majorVersion) {
343344 return *this ;
344345}
345346
347+ InFlightDiagnostic &
348+ InFlightDiagnostic::warnUntilSwiftVersion (unsigned majorVersion) {
349+ return limitBehaviorUntilSwiftVersion (DiagnosticBehavior::Warning,
350+ majorVersion);
351+ }
352+
346353InFlightDiagnostic &
347354InFlightDiagnostic::warnInSwiftInterface (const DeclContext *context) {
348355 auto sourceFile = context->getParentSourceFile ();
You can’t perform that action at this time.
0 commit comments