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 {
575
575
return limitBehavior (limit);
576
576
}
577
577
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
+
578
586
// / Limit the diagnostic behavior to warning until the specified version.
579
587
// /
580
588
// / 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) {
328
328
}
329
329
330
330
InFlightDiagnostic &
331
- InFlightDiagnostic::warnUntilSwiftVersion (unsigned majorVersion) {
331
+ InFlightDiagnostic::limitBehaviorUntilSwiftVersion (
332
+ DiagnosticBehavior limit, unsigned majorVersion) {
332
333
if (!Engine->languageVersion .isVersionAtLeast (majorVersion)) {
333
- limitBehavior (DiagnosticBehavior::Warning )
334
+ limitBehavior (limit )
334
335
.wrapIn (diag::error_in_future_swift_version, majorVersion);
335
336
}
336
337
@@ -343,6 +344,12 @@ InFlightDiagnostic::warnUntilSwiftVersion(unsigned majorVersion) {
343
344
return *this ;
344
345
}
345
346
347
+ InFlightDiagnostic &
348
+ InFlightDiagnostic::warnUntilSwiftVersion (unsigned majorVersion) {
349
+ return limitBehaviorUntilSwiftVersion (DiagnosticBehavior::Warning,
350
+ majorVersion);
351
+ }
352
+
346
353
InFlightDiagnostic &
347
354
InFlightDiagnostic::warnInSwiftInterface (const DeclContext *context) {
348
355
auto sourceFile = context->getParentSourceFile ();
You can’t perform that action at this time.
0 commit comments