mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
32 lines
552 B
Swift
32 lines
552 B
Swift
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.15 -swift-version 5
|
|
// REQUIRES: OS=macosx
|
|
|
|
import SwiftUI
|
|
|
|
protocol TestLayout {}
|
|
extension TestLayout {
|
|
func callAsFunction<V: View>(_ f: () -> V) -> some View {
|
|
return f()
|
|
}
|
|
}
|
|
struct EqualWidthHStack : TestLayout {}
|
|
extension EqualWidthHStack: View {
|
|
var body : some View {
|
|
Spacer()
|
|
}
|
|
}
|
|
|
|
struct EmptyView: View {
|
|
var body : some View {
|
|
Spacer()
|
|
}
|
|
}
|
|
|
|
struct MyView: View {
|
|
var body : some View {
|
|
EqualWidthHStack {
|
|
EmptyView()
|
|
}
|
|
}
|
|
}
|