Skip to content

Commit 43d3bb4

Browse files
authored
Merge pull request #60289 from nkcsgexi/97748740
2 parents 84b359e + 3786a8c commit 43d3bb4

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ static void forEachOuterDecl(DeclContext *DC, Fn fn) {
180180
static void computeExportContextBits(ASTContext &Ctx, Decl *D,
181181
bool *spi, bool *implicit, bool *deprecated,
182182
Optional<PlatformKind> *unavailablePlatformKind) {
183-
if (D->isSPI())
183+
if (D->isSPI() ||
184+
D->isAvailableAsSPI())
184185
*spi = true;
185186

186187
// Defer bodies are desugared to an implicit closure expression. We need to

test/Sema/spi-available-context.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// REQUIRES: VENDOR=apple
2+
// REQUIRES: OS=macosx
3+
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx11.9 -library-level api
4+
5+
@_spi_available(macOS 10.4, *)
6+
public protocol Foo { }
7+
8+
@_spi_available(macOS 10.4, *)
9+
public class Bar {
10+
public var foo: Foo?
11+
}

0 commit comments

Comments
 (0)