Avatar
Avatar
koher
@swift-main protocol View { } struct FooView: View { } struct BarView: View { } struct TupleView<T>: View { let content: T init(_ content: T) { self.content = content } } func buildBlock<C0>(_ c0: C0) -> TupleView<(C0)> where C0 : View { TupleView(c0) } let view0: any View = FooView() print(buildBlock(view0))
swiftNightly BOT 6/3/2022 2:43 AM
exit status: 1 with stderr:<stdin>:22:7: error: type 'any View' cannot conform to 'View' print(buildBlock(view0)) ^ <stdin>:22:7: note: only concrete types such as structs, enums and classes can conform to protocols print(buildBlock(view0)) ^ <stdin>:17:6: note: required by global function 'buildBlock' where 'C0' = 'any View' func buildBlock<C0>(_ c0: C0) -> TupleView<(C0)> where C0 : View { ^