Skip to content

Commit

Permalink
Update ViewBuilder.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Feb 2, 2025
1 parent cef426f commit 12581c8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Sources/OpenSwiftUICore/View/ViewBuilder.swift
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
//
// ViewBuilder.swift
// OpenSwiftUI
// OpenSwiftUICore
//
// Audited for RELEASE_2023
// Audited for iOS 18.0
// Status: Complete

@resultBuilder
public enum ViewBuilder {
public struct ViewBuilder {
@_alwaysEmitIntoClient
public static func buildExpression<Content>(_ content: Content) -> Content where Content: View {
content
}

@available(*, unavailable, message: "this expression does not conform to 'View'")
@_disfavoredOverload
@_alwaysEmitIntoClient
public static func buildExpression(_ invalid: Any) -> some View {
fatalError()
}

@_alwaysEmitIntoClient
public static func buildBlock() -> EmptyView {
Expand All @@ -30,7 +37,7 @@ public enum ViewBuilder {
}

@available(*, unavailable)
extension ViewBuilder: Swift.Sendable {}
extension ViewBuilder: Sendable {}

extension ViewBuilder {
@_alwaysEmitIntoClient
Expand Down

0 comments on commit 12581c8

Please sign in to comment.