Closed avinizhanov closed 10 months ago
This works fine:
try await viewModel.getDevice(id: id)
and one also works fine:
let device = try await viewModel.getDevice(id: id)
But if I try to assign result to existing variable I get error:
var device: Device? device = try await viewModel.getDevice(id: id)
'!', <prefix expression> or '?' expected, got 'await'
Looks like problem with await, because this one also works fine:
await
var device: Response? device = try viewModel.getDevice(id: id)
Plugin version: 0.17.0.123-232
Thanks! I've fixed this for the next update and reported it upstream to the Swift grammar spec: https://github.com/apple/swift-book/issues/179
This works fine:
and one also works fine:
But if I try to assign result to existing variable I get error:
Looks like problem with
await
, because this one also works fine:Plugin version: 0.17.0.123-232