mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[test] Add test case for rdar://116956363
This commit is contained in:
20
test/Constraints/rdar116956363.swift
Normal file
20
test/Constraints/rdar116956363.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
// RUN: %target-typecheck-verify-swift
|
||||
|
||||
// rdar://116956363 - Make sure we don't crash here.
|
||||
@resultBuilder
|
||||
struct Builder {
|
||||
static func buildBlock<T>(_ x: T) -> T { x }
|
||||
}
|
||||
|
||||
func bar(_ fn: () -> Void) -> Int { 0 }
|
||||
|
||||
@Builder
|
||||
func foo(_ b: Bool) -> Int {
|
||||
bar {
|
||||
let _ = if b {
|
||||
1
|
||||
} else {
|
||||
2
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user