mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
21 lines
322 B
Swift
21 lines
322 B
Swift
// 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
|
|
}
|
|
}
|
|
}
|