Skip to content

Commit 8a999b2

Browse files
authored
Enabled ExistentialAny setting (#5)
1 parent f3c3d13 commit 8a999b2

File tree

13 files changed

+26
-19
lines changed

13 files changed

+26
-19
lines changed

Package.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let package = Package(
3838
name: "PrincipleMacros",
3939
dependencies: [
4040
.product(
41-
name: "Principle",
41+
name: "PrincipleCollections",
4242
package: "Principle"
4343
),
4444
.product(
@@ -63,3 +63,10 @@ let package = Package(
6363
)
6464
]
6565
)
66+
67+
for target in package.targets {
68+
target.swiftSettings = (target.swiftSettings ?? []) + [
69+
.swiftLanguageMode(.v6),
70+
.enableUpcomingFeature("ExistentialAny")
71+
]
72+
}

Sources/PrincipleMacros/Builders/Declarations/Common/DeclBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import SwiftSyntax
1010

1111
public protocol DeclBuilder {
1212

13-
var basicDeclaration: BasicDeclSyntax { get }
13+
var basicDeclaration: any BasicDeclSyntax { get }
1414
var settings: DeclBuilderSettings { get }
1515

1616
func build() throws -> [DeclSyntax]

Sources/PrincipleMacros/Builders/Declarations/Members/PropertyDeclBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public protocol PropertyDeclBuilder: MemberDeclBuilder {
1515

1616
extension PropertyDeclBuilder {
1717

18-
public var basicDeclaration: BasicDeclSyntax {
18+
public var basicDeclaration: any BasicDeclSyntax {
1919
property.declaration
2020
}
2121
}

Sources/PrincipleMacros/Builders/Declarations/Types/ClassDeclBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public protocol ClassDeclBuilder: TypeDeclBuilder {
1515

1616
extension ClassDeclBuilder {
1717

18-
public var typeDeclaration: TypeDeclSyntax {
18+
public var typeDeclaration: any TypeDeclSyntax {
1919
declaration
2020
}
2121
}

Sources/PrincipleMacros/Builders/Declarations/Types/EnumDeclBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public protocol EnumDeclBuilder: TypeDeclBuilder {
1515

1616
extension EnumDeclBuilder {
1717

18-
public var typeDeclaration: TypeDeclSyntax {
18+
public var typeDeclaration: any TypeDeclSyntax {
1919
declaration
2020
}
2121
}

Sources/PrincipleMacros/Builders/Declarations/Types/StatefulDeclBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import SwiftSyntax
1010

1111
public protocol StatefulDeclBuilder: TypeDeclBuilder {
1212

13-
var declaration: StatefulDeclSyntax { get }
13+
var declaration: any StatefulDeclSyntax { get }
1414
}
1515

1616
extension StatefulDeclBuilder {
1717

18-
public var typeDeclaration: TypeDeclSyntax {
18+
public var typeDeclaration: any TypeDeclSyntax {
1919
declaration
2020
}
2121
}

Sources/PrincipleMacros/Builders/Declarations/Types/StructDeclBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public protocol StructDeclBuilder: TypeDeclBuilder {
1515

1616
extension StructDeclBuilder {
1717

18-
public var typeDeclaration: TypeDeclSyntax {
18+
public var typeDeclaration: any TypeDeclSyntax {
1919
declaration
2020
}
2121
}

Sources/PrincipleMacros/Builders/Declarations/Types/TypeDeclBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import SwiftSyntax
1010

1111
public protocol TypeDeclBuilder: DeclBuilder {
1212

13-
var typeDeclaration: TypeDeclSyntax { get }
13+
var typeDeclaration: any TypeDeclSyntax { get }
1414
}
1515

1616
extension TypeDeclBuilder {
1717

18-
public var basicDeclaration: BasicDeclSyntax {
18+
public var basicDeclaration: any BasicDeclSyntax {
1919
typeDeclaration
2020
}
2121
}

Sources/PrincipleMacros/Parsers/Common/Parser.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public protocol Parser {
1414
associatedtype ResultsCollection: ParserResultsCollection
1515

1616
static func parse(
17-
declaration: DeclSyntaxProtocol,
18-
in context: MacroExpansionContext
17+
declaration: any DeclSyntaxProtocol,
18+
in context: any MacroExpansionContext
1919
) -> ResultsCollection
2020

2121
static func parse(
2222
memberBlock: MemberBlockSyntax,
23-
in context: MacroExpansionContext
23+
in context: any MacroExpansionContext
2424
) -> ResultsCollection
2525
}

Sources/PrincipleMacros/Parsers/Common/_Parser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extension _Parser {
1616

1717
public static func parse(
1818
memberBlock: MemberBlockSyntax,
19-
in context: MacroExpansionContext
19+
in context: any MacroExpansionContext
2020
) -> ResultsCollection {
2121
ResultsCollection(
2222
memberBlock.members.flatMap { member in

0 commit comments

Comments
 (0)