Skip to content

Commit c33f363

Browse files
committed
[test] Update Regex type for flattened captures
1 parent 69c06f9 commit c33f363

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/Parse/switch.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ func f1(x: String, y: Whichever) {
336336
break
337337
case Whichever.buzz: // expected-error {{type 'Whichever' has no member 'buzz'}}
338338
break
339-
case Whichever.alias: // expected-error {{referencing operator function '~=' on 'RegexComponent' requires that 'Whichever' conform to 'RegexComponent'}}
339+
case Whichever.alias: // expected-error {{expression pattern of type 'Whichever' cannot match values of type 'String'}}
340+
// expected-note@-1 {{overloads for '~=' exist}}
340341
break
341342
default:
342343
break

test/StringProcessing/Sema/regex_literal_type_inference.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ let r7 = #/(?:(?:(.(.(.)*)?))*?)?/#
3333
// ^ 1
3434
// ^ 2
3535
// ^ 3
36-
let _: Regex<(Substring, Substring??, Substring???, Substring????)>.Type = type(of: r7)
36+
let _: Regex<(Substring, Substring?, Substring?, Substring?)>.Type = type(of: r7)
3737

3838
let r8 = #/well(?<theres_no_single_element_tuple_what_can_we>do)/#
3939
let _: Regex<(Substring, theres_no_single_element_tuple_what_can_we: Substring)>.Type = type(of: r8)

0 commit comments

Comments
 (0)