// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.15 -swift-version 5 -disable-availability-checking // REQUIRES: objc_interop // REQUIRES: OS=macosx import SwiftUI protocol Model { associatedtype ReturnType } struct AnyModel: Model { } protocol ContentProtocol : View { associatedtype _Context } struct CollectionContext { let offset: Data.Index } struct ContinuousContent : ContentProtocol where Data.Element: Model, Data.Element.ReturnType: Sequence, Data.Index: Hashable { typealias _Context = CollectionContext var body: some View { EmptyView() } } struct TestView : View { typealias Context = Content._Context where Content: ContentProtocol init(_ data: Data, @ViewBuilder shelfContent: @escaping ([Context]) -> C) where Data.Element == any Model, Content == ContinuousContent>, C> { } var body: some View { EmptyView() } } @ViewBuilder func test(values: [any Model<[Int]>]) -> some View { TestView(values) { context in VStack { if context.first?.offset == 0 { } } } }