Skip to content

Commit

Permalink
Fix ambiguous use of buildFinalResult in Swift 5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mkj-is committed Aug 12, 2023
1 parent 130ab41 commit 7a3626d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Sources/PathBuilder/Path components/Subpath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public struct Subpath: PathComponent {
/// - Parameters:
/// - transform: An affine transform to apply to the subpath before adding to the path.
/// - builder: Result builder for creating the path from components.
public init(transform: CGAffineTransform = .identity, @PathBuilder _ builder: () -> Path) {
public init(transform: CGAffineTransform = .identity, @PathBuilder _ builder: () -> PathComponent) {
self.transform = transform
self.path = builder()
self.path = Path(builder)
}

/// Intializes subpath with shape filling the provided rectangle.
Expand Down
4 changes: 2 additions & 2 deletions Sources/PathBuilder/Path+PathBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SwiftUI

public extension Path {
/// Initializes path using custom attribute path builder.
init(@PathBuilder _ builder: () -> Path) {
self = builder()
init(@PathBuilder _ builder: () -> PathComponent) {
self = Path(builder().add(to:))
}
}
8 changes: 0 additions & 8 deletions Sources/PathBuilder/PathBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ public struct PathBuilder {
public static func buildLimitedAvailability(_ component: PathComponent) -> PathComponent {
component
}

/// This will be called on the partial result from the outermost
/// block statement to produce the final returned result `Path`.
public static func buildFinalResult(_ component: PathComponent) -> Path {
Path { path in
component.add(to: &path)
}
}

/// This will be called on the final result from the outermost
/// block statement to produce the partial `PathComponent`.
Expand Down

0 comments on commit 7a3626d

Please sign in to comment.