Recent refactoring fixed a bug that previously caused `f()` to be checked as if
it were unavailable only on macOS in the following example:
```
@available(macOS, unavailable)
struct Outer {
@available(*, unavailable)
func f() {
someFunctionUnavailableOnMacOS()
}
}
```
Unfortunately, fixing that bug made a different existing availability checking
rule more problematic. References to declarations that are unavailable on the
current platform have been diagnosed as unavailable even in contexts that are
universally unavailable. This long standing behavior is overly strict but it
rarely had consequences. However, now that the example above is modeled
correctly, this overly strict behavior is causing some source compatibility
issues. The easiest solution is to relax the overly strict checking.
Resolves rdar://141124478.
Availability checking for types was only suppressed when the immediate context
for the use of the type was explicitly marked unavailable. Availability is
lexical so the checking should be suppressed in the entire scope instead.
Rewrite attr_availability_transitive_osx.swift to be more use a more thorough
cartesian product approach to testing possible combinations. Free up
Sema/availability.swift to run on platforms besides macOS.
NFC.
When the type checker noticed that a declaration with application extension
availability markup was used somewhere that it would be potentially unavailable
at runtime, the fix-it emitted by the compiler would check for the application
extension platform's availability:
```
if #available(macOSApplicationExtension 12, *) {
// Use potentially unavailable declarations
}
```
This runtime check won't work. The fix-it should just suggest checking the
availability of the base, non-extension platform instead.
Resolves rdar://125860317.