   lazy var z: Int = 42
 }
 
+@available(macOS 40, *)
+public struct PublicStruct {
+  // expected-error@+1 {{stored properties cannot be marked potentially unavailable with '@available'}}
+  @available(macOS 50, *)
+  public var x: NewStruct
+
+  // expected-error@+1 {{stored properties cannot be marked potentially unavailable with '@available'}}
+  @available(macOS 50, *)
+  @NewPropertyWrapper public var y: Int
+
+  // expected-error@+1 {{stored properties cannot be marked potentially unavailable with '@available'}}
+  @available(macOS 50, *)
+  public lazy var z: Int = 42
+}
+
 // The same behavior should hold for enum elements with payloads.
 @available(macOS 50, *)
 enum GoodReferenceEnum {

// Code should type check with a new enough deployment target:
// RUN: %target-swift-frontend -typecheck %s -target %target-cpu-apple-macos50

// REQUIRES: OS=macosx

@available(macOS 50, *)
struct NewStruct {}

@available(macOS 50, *)
@propertyWrapper
struct NewPropertyWrapper<Value> {
  var wrappedValue: Value
}

@available(macOS 50, *)

  @available(macOS 50, *)
  case x(NewStruct)
}

@available(macOS 40, *)
public enum PublicReferenceEnum {
  // expected-error@+1 {{enum cases with associated values cannot be marked potentially unavailable with '@available'}}
  @available(macOS 50, *)
  case x(NewStruct)
}
