Possible to use `@discardableResult` together with `@MainActor` annotation?

@MainActor
@discardableResult
func foo() -> String { "bar!" }

When used I have to write
_ = foo()

To not get Result of call to function returning 'String' is unused warning.

So I try change order of annotation to:

@discardableResult
@MainActor
func foo() -> String { "bar!" }

Same result. Feels like a bug? Ought to be possible right?

This has been fixed but the fix didn't make it into Xcode 14.0.

1 Like