We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0a99491 + a76d5ab commit ba32759Copy full SHA for ba32759
test/Constraints/issue-71040.swift
@@ -0,0 +1,26 @@
1
+// RUN: %target-typecheck-verify-swift
2
+
3
+// https://github.com/apple/swift/issues/71040
4
5
+@resultBuilder
6
+struct Builder {
7
+ static func buildBlock<T>(_ components: T...) -> T {
8
+ components.first!
9
+ }
10
+}
11
12
+struct S<T> {
13
+ init(_ fn: () -> T) {}
14
15
16
+func foo<T>(@Builder _ fn: () -> T) {}
17
18
+@Builder
19
+func bar() {
20
+ foo {
21
+ S<Int> {
22
+ let x = if .random() { 0 } else { 1 }
23
+ return x
24
25
26
0 commit comments