Avatar
Avatar
Iceman
@swift-main @swift-5.9.2 @swift-5.10 func f() throws -> String { "" } let _ = try switch f() { default: "" }
swiftNightly BOT 3/4/2024 9:03 AM
<stdin>:2:20: warning: call can throw but is not marked with 'try'; this is an error in Swift 6 1 │ func f() throws -> String { "" } 2 │ let _ = try switch f() { │ ├─ warning: call can throw but is not marked with 'try'; this is an error in Swift 6 │ ├─ note: did you mean to use 'try'? │ ├─ note: did you mean to handle error as optional value? │ ╰─ note: did you mean to disable error propagation? 3 │ default: "" 4 │ } <stdin>:2:9: warning: 'try' has no effect on 'switch' expression 1 │ func f() throws -> String { "" } 2 │ let _ = try switch f() { │ ╰─ warning: 'try' has no effect on 'switch' expression 3 │ default: "" 4 │ }