Skip to content

Commit 3b7a8f9

Browse files
[tests] Adapt other tests to changes of SR-14505
1 parent 7760280 commit 3b7a8f9

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

test/AutoDiff/SILOptimizer/differentiation_diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func try_apply_rethrows(_ x: Float) -> Float {
5555
@differentiable(reverse)
5656
func noReturn(_ x: Float) -> Float {
5757
let _ = x
58-
// expected-error @+2 {{missing return in a function expected to return 'Float'}}
58+
// expected-error @+2 {{missing return in a global function expected to return 'Float'}}
5959
// expected-note @+1 {{missing return for differentiation}}
6060
}
6161

test/FixCode/fixits-omit-return.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
func ff_fixit_addreturn() -> String {
44
print("entering ff_fixit_addreturn()")
5-
"foo" // expected-warning {{string literal is unused}} expected-error {{missing return in a function expected to return 'String'; did you mean to return the last expression?}} {{5-5=return }}
5+
"foo" // expected-warning {{string literal is unused}} expected-error {{missing return in a global function expected to return 'String'; did you mean to return the last expression?}} {{5-5=return }}
66
}
77

88
let cl_fixit_addreturn: () -> String = {
@@ -13,7 +13,7 @@ let cl_fixit_addreturn: () -> String = {
1313
func ff_fixit_addreturn_ifdecl() -> String {
1414
#if true
1515
print("entering ff_fixit_addreturn_ifdecl()")
16-
"foo" // expected-warning {{string literal is unused}} expected-error {{missing return in a function expected to return 'String'; did you mean to return the last expression?}} {{5-5=return }}
16+
"foo" // expected-warning {{string literal is unused}} expected-error {{missing return in a global function expected to return 'String'; did you mean to return the last expression?}} {{5-5=return }}
1717
#endif
1818
}
1919

test/Frontend/allow-errors.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ func test(s: ValidStructInvalidMember) {
7070
// Check SIL diagnostics are still output (no reason not to output SIL since
7171
// there were no errors)
7272
func other() -> Int {}
73-
// CHECK-VALID: allow-errors.swift:[[@LINE-1]]:22: error: missing return in a function expected to return 'Int'
73+
// CHECK-VALID: allow-errors.swift:[[@LINE-1]]:22: error: missing return in a global function expected to return 'Int'
7474
func other2() -> Bool {}
75-
// CHECK-VALID: allow-errors.swift:[[@LINE-1]]:24: error: missing return in a function expected to return 'Bool'
75+
// CHECK-VALID: allow-errors.swift:[[@LINE-1]]:24: error: missing return in a global function expected to return 'Bool'
7676
#endif
7777

7878
// All invalid uses should have no errors in the file itself, all referenced

test/SourceKit/Sema/enum-toraw/enum-toraw.swift.response

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
key.column: 1,
1919
key.filepath: t2.swift,
2020
key.severity: source.diagnostic.severity.error,
21-
key.description: "missing return in a function expected to return 'Bool'",
21+
key.description: "missing return in a global function expected to return 'Bool'",
2222
key.diagnostic_stage: source.diagnostic.stage.swift.sema
2323
}
2424
]

0 commit comments

Comments
 (0)