mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
26 lines
727 B
Swift
26 lines
727 B
Swift
// RUN: %target-swift-frontend -emit-ir %s
|
|
|
|
// https://github.com/apple/swift/issues/58100
|
|
|
|
public struct Observable<T> {}
|
|
|
|
public protocol BaseVariant: CaseIterable, Equatable {}
|
|
|
|
public protocol FeatureGate {
|
|
associatedtype Variant: BaseVariant
|
|
}
|
|
|
|
public enum FeatureVariantState<T: BaseVariant>: Equatable {}
|
|
|
|
public protocol BaseGatingProvider {
|
|
func exposeFeatureVariantState<G: FeatureGate>(for featureGate: G)
|
|
-> Observable<FeatureVariantState<G.Variant>>
|
|
}
|
|
|
|
public struct UserFeatureGate<Variant: BaseVariant>: FeatureGate {}
|
|
|
|
public protocol UserGatingProvider: BaseGatingProvider {
|
|
func exposeFeatureVariantState<V>(for featureGate: UserFeatureGate<V>)
|
|
-> Observable<FeatureVariantState<V>>
|
|
}
|