You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// CHECK-NEXT: } // end sil function '_TF6errors28testOptionalTryNeverFailsVarFT_T_'
844
844
func testOptionalTryNeverFailsVar(){
845
-
varunit:()?=try?() // expected-warning {{no calls to throwing functions occur within 'try' expression}} expected-warning {{initialization of variable 'unit' was never used; consider replacing with assignment to '_' or removing it}}
845
+
varunit:()?=try?() // expected-warning {{no calls to throwing functions occur within 'try' expression}} expected-warning {{variable 'unit' was never used; consider replacing with '_' or removing it}}
846
846
}
847
847
848
848
// CHECK-LABEL: sil hidden @_TF6errors36testOptionalTryNeverFailsAddressOnly
Copy file name to clipboardExpand all lines: test/decl/var/usage.swift
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -246,3 +246,9 @@ func test(_ a : Int?, b : Any) {
246
246
247
247
}
248
248
249
+
func test2(){
250
+
leta=4 // expected-warning {{initialization of immutable value 'a' was never used; consider replacing with assignment to '_' or removing it}} {{3-8=_}}
251
+
var( b )=6 // expected-warning {{initialization of variable 'b' was never used; consider replacing with assignment to '_' or removing it}} {{3-12=_}}
252
+
varc:Int=4 // expected-warning {{variable 'c' was never used; consider replacing with '_' or removing it}} {{7-8=_}}
253
+
let(d):Int=9 // expected-warning {{immutable value 'd' was never used; consider replacing with '_' or removing it}} {{8-9=_}}
0 commit comments