Skip to content

Commit 85b08cd

Browse files
authored
Merge pull request #69362 from hamishknight/add-test
[test] Add test case for rdar://116956363
2 parents 38b5339 + db32831 commit 85b08cd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/Constraints/rdar116956363.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
// rdar://116956363 - Make sure we don't crash here.
4+
@resultBuilder
5+
struct Builder {
6+
static func buildBlock<T>(_ x: T) -> T { x }
7+
}
8+
9+
func bar(_ fn: () -> Void) -> Int { 0 }
10+
11+
@Builder
12+
func foo(_ b: Bool) -> Int {
13+
bar {
14+
let _ = if b {
15+
1
16+
} else {
17+
2
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)