@@ -475,9 +475,11 @@ func stringliterals(_ d: [String: Int]) {
475
475
let x = 4
476
476
" Hello \( x+ 1 ) world " // expected-warning {{string literal is unused}}
477
477
478
- " Error: \( x+ 1 " ; // expected-error {{unterminated string literal}}
479
-
480
- " Error: \( x+ 1 // expected-error {{unterminated string literal}}
478
+ // expected-error @+1 {{unterminated string literal}}
479
+ " Error: \( x+ 1 " ; // expected-error {{cannot find ')' to match opening '(' in string interpolation}}
480
+
481
+ // expected-error @+1 {{unterminated string literal}}
482
+ " Error: \( x+ 1 // expected-error {{cannot find ')' to match opening '(' in string interpolation}}
481
483
; // expected-error {{';' statements are not allowed}}
482
484
483
485
// rdar://14050788 [DF] String Interpolations can't contain quotes
@@ -488,15 +490,16 @@ func stringliterals(_ d: [String: Int]) {
488
490
" test \( " quoted-paren ( " ) "
489
491
" test \( " \\ " ) "
490
492
" test \( " \n " ) "
491
- " test \( " \" ) " // expected-error {{unterminated string literal}}
493
+ " test \( " \" ) " // expected-error {{cannot find ')' to match opening '(' in string interpolation}} expected-error {{ unterminated string literal}}
492
494
493
495
" test \
494
496
// expected-error @-1 {{unterminated string literal}} expected-error @-1 {{invalid escape sequence in literal}}
495
497
" test \( " \
496
- // expected-error @-1 {{unterminated string literal}}
498
+ // expected-error @-1 {{cannot find ')' to match opening '(' in string interpolation}} expected-error @-1 {{ unterminated string literal}}
497
499
" test newline \( " something " +
498
500
" something else " ) "
499
- // expected-error @-2 {{unterminated string literal}} expected-error @-1 {{unterminated string literal}}
501
+ // expected-error @-2 {{cannot find ')' to match opening '(' in string interpolation}}
502
+ // expected-error @-2 {{unterminated string literal}} expected-error @-3 {{unterminated string literal}}
500
503
501
504
// expected-warning @+2 {{variable 'x2' was never used; consider replacing with '_' or removing it}}
502
505
// expected-error @+1 {{unterminated string literal}}
@@ -939,10 +942,10 @@ let _ = 0xFFF_FFFF_FFFF_FFFF as Int64
939
942
940
943
// rdar://problem/20289969 - string interpolation with comment containing ')' or '"'
941
944
let _ = " foo \( 42 /* ) " ) */) "
942
- let _ = " foo \( foo // ) " // expected-error {{unterminated string literal}}
945
+ let _ = " foo \( foo // ) " // expected-error {{cannot find ')' to match opening '(' in string interpolation}} expected-error {{ unterminated string literal}}
943
946
let _ = " foo \( 42 /*
944
947
* multiline comment
945
948
*/) end "
946
- // expected-error @-3 {{unterminated string literal}}
949
+ // expected-error @-3 {{cannot find ')' to match opening '(' in string interpolation}} expected-error @-3 {{ unterminated string literal}}
947
950
// expected-error @-2 {{expected expression}}
948
951
// expected-error @-3 {{unterminated string literal}}
0 commit comments