I'm working on some code that uses UIBarButtonItem.flexibleSpace (introduced in iOS 14 and tvOS 14) and UIToolbar (doesn't exist in tvOS). Turns out those availabilities interact in a very unintuitive way: the required annotations are
It's a long standing issue; there's no point in diagnosing potential unavailability on a given platform in a context that is unavailable on that platform, but the compiler implementation doesn't yet take that into account. I'm hoping to address it in the Swift 6.2 compiler because the fix should be easier now thanks to some refactoring.
Note that you can spell the workaround this way if you find it makes it easier to follow: