mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
25 lines
340 B
Swift
25 lines
340 B
Swift
// RUN: %target-swift-frontend -typecheck %s
|
|
|
|
@resultBuilder
|
|
struct SillyBuilder {
|
|
static func buildBlock() -> () {}
|
|
}
|
|
|
|
struct SillyStruct {
|
|
init(@SillyBuilder _: () -> ()) {}
|
|
}
|
|
|
|
struct UsesSillyStruct {
|
|
var x: Int = 0
|
|
|
|
func foo() {
|
|
SillyStruct {
|
|
let fn = {
|
|
if true {
|
|
_ = x
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|