@@ -368,6 +368,7 @@ func checkDiagnosticMinimality(x: Runcible?) {
368368 // expected-note@-1 {{add missing case: '(.fork, _)'}}
369369 // expected-note@-2 {{add missing case: '(.hat, .hat)'}}
370370 // expected-note@-3 {{add missing case: '(_, .fork)'}}
371+ // expected-note@-4 {{add missing cases}} {{+11:3-3=case (.fork, _):\n<#code#>\ncase (.hat, .hat):\n<#code#>\ncase (_, .fork):\n<#code#>\n}}
371372 case ( . spoon, . spoon) :
372373 break
373374 case ( . spoon, . hat) :
@@ -381,6 +382,7 @@ func checkDiagnosticMinimality(x: Runcible?) {
381382 // expected-note@-2 {{add missing case: '(.hat, .spoon)'}}
382383 // expected-note@-3 {{add missing case: '(.spoon, .hat)'}}
383384 // expected-note@-4 {{add missing case: '(_, .fork)'}}
385+ // expected-note@-5 {{add missing cases}} {{+10:3-3=case (.fork, _):\n<#code#>\ncase (.hat, .spoon):\n<#code#>\ncase (.spoon, .hat):\n<#code#>\ncase (_, .fork):\n<#code#>\n}}
384386 case ( . spoon, . spoon) :
385387 break
386388 case ( . hat, . hat) :
@@ -405,6 +407,7 @@ enum LargeSpaceEnum {
405407func notQuiteBigEnough( ) -> Bool {
406408 switch ( LargeSpaceEnum . case1, LargeSpaceEnum . case2) { // expected-error {{switch must be exhaustive}}
407409 // expected-note@-1 110 {{add missing case:}}
410+ // expected-note@-2 {{add missing cases}}
408411 case ( . case0, . case0) : return true
409412 case ( . case1, . case1) : return true
410413 case ( . case2, . case2) : return true
@@ -443,6 +446,7 @@ enum ContainsOverlyLargeEnum {
443446func quiteBigEnough( ) -> Bool {
444447 switch ( OverlyLargeSpaceEnum . case1, OverlyLargeSpaceEnum . case2) { // expected-error {{switch must be exhaustive}}
445448 // expected-note@-1 132 {{add missing case:}}
449+ // expected-note@-2 {{add missing cases}}
446450 case ( . case0, . case0) : return true
447451 case ( . case1, . case1) : return true
448452 case ( . case2, . case2) : return true
@@ -543,7 +547,7 @@ func quiteBigEnough() -> Bool {
543547 }
544548
545549 // Make sure we haven't just stopped emitting diagnostics.
546- switch OverlyLargeSpaceEnum . case1 { // expected-error {{switch must be exhaustive}} expected-note 12 {{add missing case}}
550+ switch OverlyLargeSpaceEnum . case1 { // expected-error {{switch must be exhaustive}} expected-note 12 {{add missing case}} expected-note {{add missing cases}}
547551 }
548552}
549553
@@ -564,12 +568,14 @@ indirect enum MutuallyRecursive {
564568func infinitelySized( ) -> Bool {
565569 switch ( InfinitelySized . one, InfinitelySized . one) { // expected-error {{switch must be exhaustive}}
566570 // expected-note@-1 8 {{add missing case:}}
571+ // expected-note@-2 {{add missing cases}}
567572 case ( . one, . one) : return true
568573 case ( . two, . two) : return true
569574 }
570575
571576 switch ( MutuallyRecursive . one, MutuallyRecursive . one) { // expected-error {{switch must be exhaustive}}
572577 // expected-note@-1 8 {{add missing case:}}
578+ // expected-note@-2 {{add missing cases}}
573579 case ( . one, . one) : return true
574580 case ( . two, . two) : return true
575581 }
@@ -840,7 +846,7 @@ public enum NonExhaustivePayload {
840846// case.
841847@inlinable
842848public func testNonExhaustive( _ value: NonExhaustive , _ payload: NonExhaustivePayload , for interval: TemporalProxy , flag: Bool ) {
843- switch value { // expected-error {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b'}} {{none}}
849+ switch value { // expected-error {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b'}} {{+2:3-3=case .b:\n<#code#>\n}}
844850 case . a: break
845851 }
846852
@@ -861,12 +867,16 @@ public func testNonExhaustive(_ value: NonExhaustive, _ payload: NonExhaustivePa
861867 @unknown case _: break // no-warning
862868 }
863869
864- switch value { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b'}} {{none}}
870+ switch value { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b'}} {{+2:3-3=case .b:\n<#code#>\n}}
865871 case . a: break
866872 @unknown case _: break
867873 }
868874
869- switch value { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.a'}} {{none}} expected-note {{add missing case: '.b'}} {{none}}
875+ switch value {
876+ // expected-warning@-1 {{switch must be exhaustive}} {{none}}
877+ // expected-note@-2 {{add missing case: '.a'}} {{+5:3-3=case .a:\n<#code#>\n}}
878+ // expected-note@-3 {{add missing case: '.b'}} {{+5:3-3=case .b:\n<#code#>\n}}
879+ // expected-note@-4 {{add missing cases}} {{+5:3-3=case .a:\n<#code#>\ncase .b:\n<#code#>\n}}
870880 @unknown case _: break
871881 }
872882
@@ -932,7 +942,7 @@ public func testNonExhaustive(_ value: NonExhaustive, _ payload: NonExhaustivePa
932942 } // no-warning
933943
934944 // Test payloaded enums.
935- switch payload { // expected-error {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(_)'}} {{none}}
945+ switch payload { // expected-error {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(_)'}} {{+2:3-3=case .b(_):\n<#code#>\n}}
936946 case . a: break
937947 }
938948
@@ -953,17 +963,17 @@ public func testNonExhaustive(_ value: NonExhaustive, _ payload: NonExhaustivePa
953963 @unknown case _: break // no-warning
954964 }
955965
956- switch payload { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(_)'}} {{none}}
966+ switch payload { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(_)'}} {{+2:3-3=case .b(_):\n<#code#>\n}}
957967 case . a: break
958968 @unknown case _: break
959969 }
960970
961- switch payload { // expected-error {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(true)'}} {{none}}
971+ switch payload { // expected-error {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(true)'}} {{+3:3-3=case .b(true):\n<#code#>\n}}
962972 case . a: break
963973 case . b( false ) : break
964974 }
965975
966- switch payload { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(true)'}} {{none}}
976+ switch payload { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(true)'}} {{+3:3-3=case .b(true):\n<#code#>\n}}
967977 case . a: break
968978 case . b( false ) : break
969979 @unknown case _: break
@@ -1017,12 +1027,15 @@ public func testNonExhaustiveWithinModule(_ value: NonExhaustive, _ payload: Non
10171027 @unknown case _: break // no-warning
10181028 }
10191029
1020- switch value { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b'}} {{none}}
1030+ switch value { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b'}} {{+2:3-3=case .b:\n<#code#>\n}}
10211031 case . a: break
10221032 @unknown case _: break
10231033 }
10241034
1025- switch value { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.a'}} {{none}} expected-note {{add missing case: '.b'}} {{none}}
1035+ switch value { // expected-warning {{switch must be exhaustive}} {{none}}
1036+ // expected-note@-1 {{add missing case: '.a'}} {{+4:3-3=case .a:\n<#code#>\n}}
1037+ // expected-note@-2 {{add missing case: '.b'}} {{+4:3-3=case .b:\n<#code#>\n}}
1038+ // expected-note@-3 {{add missing cases}} {{+4:3-3=case .a:\n<#code#>\ncase .b:\n<#code#>\n}}
10261039 @unknown case _: break
10271040 }
10281041
@@ -1071,7 +1084,7 @@ public func testNonExhaustiveWithinModule(_ value: NonExhaustive, _ payload: Non
10711084 }
10721085
10731086 // Test payloaded enums.
1074- switch payload { // expected-error {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(_)'}} {{none }}
1087+ switch payload { // expected-error {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(_)'}} {{+2:3-3=case .b(_):\n<#code#>\n }}
10751088 case . a: break
10761089 }
10771090
@@ -1092,17 +1105,17 @@ public func testNonExhaustiveWithinModule(_ value: NonExhaustive, _ payload: Non
10921105 @unknown case _: break // no-warning
10931106 }
10941107
1095- switch payload { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(_)'}} {{none }}
1108+ switch payload { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(_)'}} {{+2:3-3=case .b(_):\n<#code#>\n }}
10961109 case . a: break
10971110 @unknown case _: break
10981111 }
10991112
1100- switch payload { // expected-error {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(true)'}} {{none }}
1113+ switch payload { // expected-error {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(true)'}} {{+3:3-3=case .b(true):\n<#code#>\n }}
11011114 case . a: break
11021115 case . b( false ) : break
11031116 }
11041117
1105- switch payload { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(true)'}} {{none }}
1118+ switch payload { // expected-warning {{switch must be exhaustive}} {{none}} expected-note {{add missing case: '.b(true)'}} {{+3:3-3=case .b(true):\n<#code#>\n }}
11061119 case . a: break
11071120 case . b( false ) : break
11081121 @unknown case _: break
0 commit comments