Skip to content

Commit b6753bb

Browse files
committed
-
1 parent fef7ff9 commit b6753bb

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ extension DeclBuilder {
3232
public var preferredAccessControlLevel: AccessControlLevel? {
3333
nil
3434
}
35+
36+
public var inheritedAvailability: AttributeListSyntax? {
37+
basicDeclaration.availability?.trimmed.withTrailingNewline
38+
}
3539
}

Tests/PrincipleMacrosTests/Syntax/Extensions/AvailabilityTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ internal struct AvailabilityTests {
3939
let decl: DeclSyntax = """
4040
#if os(macOS)
4141
@MainActor
42+
@available(macOS 26, *)
4243
#else
4344
@Observable
4445
@available(iOS 26, *)
@@ -48,6 +49,7 @@ internal struct AvailabilityTests {
4849

4950
let expectation = """
5051
#if os(macOS)
52+
@available(macOS 26, *)
5153
#else
5254
@available(iOS 26, *)
5355
#endif

0 commit comments

Comments
 (0)