func list() throws -> [Int] { [1, 2, 3] }
try? for item in list() {
print(item)
}
which is invalid Swift code. There is probably no good solution for the try? case. try and try! could be moved in front of the list() call in the for loop just fine.
However, using try as in
try list().forEach {
print($0)
}
the keyword will completely be removed by SwiftLint. The result is
The example
is rewritten to
which is invalid Swift code. There is probably no good solution for the
try?
case.try
andtry!
could be moved in front of thelist()
call in thefor
loop just fine.However, using
try
as inthe keyword will completely be removed by SwiftLint. The result is
which is also incorrect and uncompilable.
There is the same issue for the
await
keyword.