Files
swift-mirror/test/SourceKit/Sema/issue62848.swift
Pavel Yaskevich 945f35f7ca [BuilderTransform] Make sure that synthesized if elements have correct locations
Placeholder variable that represents result of `if` should be placed
at the beginning of the statement, same goes for `Optional(.some(...))`
that wraps the expression in "then" branch.

Resolves: https://github.com/apple/swift/issues/62848
2023-01-10 12:33:30 -08:00

24 lines
464 B
Swift

// RUN: %sourcekitd-test -req=collect-type %s -- %s
struct Rectangle {
init() {}
}
@resultBuilder public struct WiewBuilder {
public static func buildBlock<Content>(_ content: Content) -> Content {
return content
}
public static func buildIf<Content>(_ content: Content?) -> Content? {
return content
}
}
public struct AStack<Content> {
init(@WiewBuilder content: () -> Content) {}
}
func foo() {
AStack {
if true {
Rectangle()