// RUN: %target-typecheck-verify-swift -swift-version 3 public struct Pair {} public struct PublicStruct { public struct Inner {} internal struct Internal {} } private typealias PrivateAlias = PublicStruct // expected-note * {{type declared here}} public let a0 = nil as PrivateAlias.Inner? // expected-warning {{constant should not be declared public because its type 'PrivateAlias.Inner?' (aka 'Optional') uses a private type}} public let a: PrivateAlias.Inner? // expected-warning {{constant should not be declared public because its type uses a private type}} public let b: PrivateAlias.Internal? // expected-error {{constant cannot be declared public because its type uses an internal type}} public let c: Pair? // expected-error {{constant cannot be declared public because its type uses an internal type}} public let c2: Pair? // expected-error {{constant cannot be declared public because its type uses an internal type}} public let d: PrivateAlias? // expected-error {{constant cannot be declared public because its type uses a private type}} // rdar://problem/21408035 private class PrivateBox { // expected-note * {{type declared here}} typealias ValueType = T typealias AlwaysFloat = Float } let boxUnboxInt: PrivateBox.ValueType = 0 // expected-warning {{constant should be declared private because its type uses a private type}} let boxFloat: PrivateBox.AlwaysFloat = 0 // expected-error {{constant must be declared private or fileprivate because its type uses a private type}} private protocol PrivateProto { associatedtype Inner } extension PublicStruct: PrivateProto {} private class SpecificBox { // expected-note * {{type declared here}} typealias InnerType = T.Inner typealias AlwaysFloat = Float } let specificBoxUnboxInt: SpecificBox.InnerType = .init() // expected-warning {{constant should be declared private because its type uses a private type}} let specificBoxFloat: SpecificBox.AlwaysFloat = 0 // expected-error {{constant must be declared private or fileprivate because its type uses a private type}}