Skip to content

Commit

Permalink
no nested protocol for you
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuawright11 committed May 22, 2024
1 parent 274973c commit 28c27f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test-macos:
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
steps:
- uses: actions/checkout@v3
- name: Build
Expand All @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
swift: [5.10]
swift: [5.9]
container: swift:${{ matrix.swift }}
steps:
- uses: actions/checkout@v3
Expand Down
14 changes: 7 additions & 7 deletions PapyrusPlugin/Sources/Models/Declaration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,7 @@ extension Declaration {

@resultBuilder
struct DeclarationsBuilder {
protocol Block {
var declarations: [Declaration] { get }
}

static func buildBlock(_ components: Block...) -> [Declaration] {
static func buildBlock(_ components: DeclarationBuilderBlock...) -> [Declaration] {
components.flatMap(\.declarations)
}

Expand Down Expand Up @@ -210,10 +206,14 @@ struct DeclarationsBuilder {
}
}

extension Declaration: DeclarationsBuilder.Block {
protocol DeclarationBuilderBlock {
var declarations: [Declaration] { get }
}

extension Declaration: DeclarationBuilderBlock {
var declarations: [Declaration] { [self] }
}

extension [Declaration]: DeclarationsBuilder.Block {
extension [Declaration]: DeclarationBuilderBlock {
var declarations: [Declaration] { self }
}

0 comments on commit 28c27f4

Please sign in to comment.