   @usableFromInline internal init() {}
 }
 
+@available(macOS, unavailable)
+@available(iOS, unavailable)
+@available(tvOS, unavailable)
+@available(watchOS, unavailable)
+public struct Unavailable {
+  @usableFromInline internal init() {}
+}
+
+// MARK: - Protocol definitions
+
+public protocol NoAvailableProto {}
+
+@available(macOS 10.9, iOS 7.0, tvOS 8.0, watchOS 1.0, *)
+public protocol BeforeInliningTargetProto {}
+
+@available(macOS 10.10, iOS 8.0, tvOS 9.0, watchOS 2.0, *)
+public protocol AtInliningTargetProto {}
+
+@available(macOS 10.14.5, iOS 12.3, tvOS 12.3, watchOS 5.3, *)
+public protocol BetweenTargetsProto {}
+
+@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
+public protocol AtDeploymentTargetProto {}
+
+@available(macOS 11, iOS 14, tvOS 14, watchOS 7, *)
+public protocol AfterDeploymentTargetProto {}
+
+@available(macOS, unavailable)
+@available(iOS, unavailable)
+@available(tvOS, unavailable)
+@available(watchOS, unavailable)
+public protocol UnavailableProto {}
+
+
 // MARK: - Internal functions
 
 //

// NON_MIN: {'BetweenTargets' is only available in}


/// Declaration with no availability annotation. Should be inferred as minimum
/// inlining target.
public struct NoAvailable {

extension AfterDeploymentTarget: PublicProto {} // expected-error {{'AfterDeploymentTarget' is only available in}} expected-note {{add @available attribute to enclosing extension}}


// MARK: - Associated types

public protocol NoAvailableProtoWithAssoc { // expected-note 3 {{add @available attribute to enclosing protocol}}
  associatedtype A: NoAvailableProto
  associatedtype B: BeforeInliningTargetProto
  associatedtype C: AtInliningTargetProto
  associatedtype D: BetweenTargetsProto // expected-error {{'BetweenTargetsProto' is only available in}}
  associatedtype E: AtDeploymentTargetProto // expected-error {{'AtDeploymentTargetProto' is only available in}}
  associatedtype F: AfterDeploymentTargetProto // expected-error {{'AfterDeploymentTargetProto' is only available in}}
}

@available(macOS 10.9, iOS 7.0, tvOS 8.0, watchOS 1.0, *)
public protocol BeforeInliningTargetProtoWithAssoc {
  associatedtype A: NoAvailableProto
  associatedtype B: BeforeInliningTargetProto
  associatedtype C: AtInliningTargetProto
  associatedtype D: BetweenTargetsProto // expected-error {{'BetweenTargetsProto' is only available in}}
  associatedtype E: AtDeploymentTargetProto // expected-error {{'AtDeploymentTargetProto' is only available in}}
  associatedtype F: AfterDeploymentTargetProto // expected-error {{'AfterDeploymentTargetProto' is only available in}}
}

@available(macOS 10.10, iOS 8.0, tvOS 9.0, watchOS 2.0, *)
public protocol AtInliningTargetProtoWithAssoc {
  associatedtype A: NoAvailableProto
  associatedtype B: BeforeInliningTargetProto
  associatedtype C: AtInliningTargetProto
  associatedtype D: BetweenTargetsProto // expected-error {{'BetweenTargetsProto' is only available in}}
  associatedtype E: AtDeploymentTargetProto // expected-error {{'AtDeploymentTargetProto' is only available in}}
  associatedtype F: AfterDeploymentTargetProto // expected-error {{'AfterDeploymentTargetProto' is only available in}}
}

@available(macOS 10.14.5, iOS 12.3, tvOS 12.3, watchOS 5.3, *)
public protocol BetweenTargetsProtoWithAssoc {
  associatedtype A: NoAvailableProto
  associatedtype B: BeforeInliningTargetProto
  associatedtype C: AtInliningTargetProto
  associatedtype D: BetweenTargetsProto
  associatedtype E: AtDeploymentTargetProto // expected-error {{'AtDeploymentTargetProto' is only available in}}
  associatedtype F: AfterDeploymentTargetProto // expected-error {{'AfterDeploymentTargetProto' is only available in}}
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public protocol AtDeploymentTargetProtoWithAssoc {
  associatedtype A: NoAvailableProto
  associatedtype B: BeforeInliningTargetProto
  associatedtype C: AtInliningTargetProto
  associatedtype D: BetweenTargetsProto
  associatedtype E: AtDeploymentTargetProto
  associatedtype F: AfterDeploymentTargetProto // expected-error {{'AfterDeploymentTargetProto' is only available in}}
}

@available(macOS 11, iOS 14, tvOS 14, watchOS 7, *)
public protocol AfterDeploymentTargetProtoWithAssoc {
  associatedtype A: NoAvailableProto
  associatedtype B: BeforeInliningTargetProto
  associatedtype C: AtInliningTargetProto
  associatedtype D: BetweenTargetsProto
  associatedtype E: AtDeploymentTargetProto
  associatedtype F: AfterDeploymentTargetProto
}

@available(macOS, unavailable)
@available(iOS, unavailable)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
public protocol UnavailableProtoWithAssoc {
  associatedtype A: NoAvailableProto
  associatedtype B: BeforeInliningTargetProto
  associatedtype C: AtInliningTargetProto
  // FIXME: Next two should be accepted for compatibility (unavailable)
  associatedtype D: BetweenTargetsProto // expected-error {{'BetweenTargetsProto' is only available in}}
  associatedtype E: AtDeploymentTargetProto // expected-error {{'AtDeploymentTargetProto' is only available in}}
  associatedtype F: AfterDeploymentTargetProto // expected-error {{'AfterDeploymentTargetProto' is only available in}}
  associatedtype G: UnavailableProto
}

@_spi(Private)
public protocol SPINoAvailableProtoWithAssoc { // expected-note 3 {{add @available attribute to enclosing protocol}}
  associatedtype A: NoAvailableProto
  associatedtype B: BeforeInliningTargetProto
  associatedtype C: AtInliningTargetProto
  // FIXME: Next two should be accepted (SPI)
  associatedtype D: BetweenTargetsProto // expected-error {{'BetweenTargetsProto' is only available in}}
  associatedtype E: AtDeploymentTargetProto // expected-error {{'AtDeploymentTargetProto' is only available in}}
  associatedtype F: AfterDeploymentTargetProto // expected-error {{'AfterDeploymentTargetProto' is only available in}}
}

// MARK: - Type aliases

public enum PublicNoAvailableEnumWithTypeAliases { // expected-note 3 {{add @available attribute to enclosing enum}}
  public typealias A = NoAvailable
  public typealias B = BeforeInliningTarget
  public typealias C = AtInliningTarget
  public typealias D = BetweenTargets // expected-error {{'BetweenTargets' is only available in}} expected-note {{add @available attribute to enclosing type alias}}
  public typealias E = AtDeploymentTarget // expected-error {{'AtDeploymentTarget' is only available in}} expected-note {{add @available attribute to enclosing type alias}}
  public typealias F = AfterDeploymentTarget // expected-error {{'AfterDeploymentTarget' is only available in}} expected-note {{add @available attribute to enclosing type alias}}
}

@available(macOS, unavailable)
@available(iOS, unavailable)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
public enum UnavailableEnumWithTypeAliases {
  public typealias A = NoAvailable
  public typealias B = BeforeInliningTarget
  public typealias C = AtInliningTarget
  // FIXME: Next two should be accepted for compatibility (unavailable)
  public typealias D = BetweenTargets // expected-error {{'BetweenTargets' is only available in}} expected-note {{add @available attribute to enclosing type alias}}
  public typealias E = AtDeploymentTarget // expected-error {{'AtDeploymentTarget' is only available in}} expected-note {{add @available attribute to enclosing type alias}}
  public typealias F = AfterDeploymentTarget // expected-error {{'AfterDeploymentTarget' is only available in}} expected-note {{add @available attribute to enclosing type alias}}
  public typealias G = Unavailable
}

@_spi(Private)
public enum SPIEnumWithTypeAliases { // expected-note 3 {{add @available attribute to enclosing enum}}
  public typealias A = NoAvailable
  public typealias B = BeforeInliningTarget
  public typealias C = AtInliningTarget
  // FIXME: Next two should be accepted (SPI)
  public typealias D = BetweenTargets // expected-error {{'BetweenTargets' is only available in}} expected-note {{add @available attribute to enclosing type alias}}
  public typealias E = AtDeploymentTarget // expected-error {{'AtDeploymentTarget' is only available in}} expected-note {{add @available attribute to enclosing type alias}}
  public typealias F = AfterDeploymentTarget // expected-error {{'AfterDeploymentTarget' is only available in}} expected-note {{add @available attribute to enclosing type alias}}
}

enum InternalNoAvailableEnumWithTypeAliases { // expected-note {{add @available attribute to enclosing enum}}
  public typealias A = NoAvailable
  public typealias B = BeforeInliningTarget
  public typealias C = AtInliningTarget
  public typealias D = BetweenTargets
  public typealias E = AtDeploymentTarget
  public typealias F = AfterDeploymentTarget // expected-error {{'AfterDeploymentTarget' is only available in}} expected-note {{add @available attribute to enclosing type alias}}
}


// MARK: - Top-level code
