Skip to content

Commit cc11e19

Browse files
[test] Add regression test for fn builders
1 parent 9c9af90 commit cc11e19

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.15 -swift-version 5 -enable-experimental-feature ResultBuilderASTTransform
2+
// REQUIRES: OS=macosx
3+
4+
import SwiftUI
5+
6+
protocol TestLayout {}
7+
extension TestLayout {
8+
func callAsFunction<V: View>(_ f: () -> V) -> some View {
9+
return f()
10+
}
11+
}
12+
struct EqualWitdthHStack : TestLayout {}
13+
extension EqualWitdthHStack: View {
14+
var body : some View {
15+
Spacer()
16+
}
17+
}
18+
19+
struct EmptyView: View {
20+
var body : some View {
21+
Spacer()
22+
}
23+
}
24+
25+
struct MyView: View {
26+
var body : some View {
27+
EqualWitdthHStack {
28+
EmptyView()
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)