Skip to content

Commit 87877bd

Browse files
committed
ABI checker: avoid diagnosing missing availability info for decls that are only explicitly available on visionOS
Resolves: rdar://145061506
1 parent a4a3a41 commit 87877bd

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

include/swift/APIDigester/ModuleAnalyzerNodes.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,11 @@ struct PlatformIntroVersion {
335335
StringRef ios;
336336
StringRef tvos;
337337
StringRef watchos;
338+
StringRef visionos;
338339
StringRef swift;
339340
bool hasOSAvailability() const {
340-
return !macos.empty() || !ios.empty() || !tvos.empty() || !watchos.empty();
341+
return !macos.empty() || !ios.empty() || !tvos.empty() ||
342+
!watchos.empty() || !visionos.empty();
341343
}
342344
};
343345

include/swift/IDE/DigesterEnums.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ KEY_STRING(IntromacOS, intro_Macosx)
157157
KEY_STRING(IntroiOS, intro_iOS)
158158
KEY_STRING(IntrotvOS, intro_tvOS)
159159
KEY_STRING(IntrowatchOS, intro_watchOS)
160+
KEY_STRING(IntrovisionOS, intro_visionOS)
160161
KEY_STRING(Introswift, intro_swift)
161162
KEY_STRING(ObjCName, objc_name)
162163
KEY_STRING(InitKind, init_kind)

lib/APIDigester/ModuleAnalyzerNodes.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ SDKNodeDecl::SDKNodeDecl(SDKNodeInitInfo Info, SDKNodeKind Kind)
130130
SugaredGenericSig(Info.SugaredGenericSig),
131131
FixedBinaryOrder(Info.FixedBinaryOrder),
132132
introVersions({Info.IntromacOS, Info.IntroiOS, Info.IntrotvOS,
133-
Info.IntrowatchOS, Info.Introswift}),
133+
Info.IntrowatchOS, Info.IntrovisionOS, Info.Introswift}),
134134
ObjCName(Info.ObjCName) {}
135135

136136
SDKNodeType::SDKNodeType(SDKNodeInitInfo Info, SDKNodeKind Kind):
@@ -1468,6 +1468,7 @@ SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, Decl *D):
14681468
IntroiOS(Ctx.getPlatformIntroVersion(D, PlatformKind::iOS)),
14691469
IntrotvOS(Ctx.getPlatformIntroVersion(D, PlatformKind::tvOS)),
14701470
IntrowatchOS(Ctx.getPlatformIntroVersion(D, PlatformKind::watchOS)),
1471+
IntrovisionOS(Ctx.getPlatformIntroVersion(D, PlatformKind::visionOS)),
14711472
Introswift(Ctx.getLanguageIntroVersion(D)),
14721473
ObjCName(Ctx.getObjcName(D)),
14731474
InitKind(Ctx.getInitKind(D)),

test/api-digester/Inputs/cake_current/cake.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ public class Zoo {
227227
public func getCurrentAnimalInlinable() -> [some Animal] {
228228
return [Dog()]
229229
}
230+
231+
@available(visionOS 1.50.4, *)
232+
public func getAnimailOnVision() -> [some Animal] {
233+
return [Dog()]
234+
}
230235
}
231236

232237
public func returnFunctionTypeOwnershipChange() -> (__owned C1) -> () { return { _ in } }

0 commit comments

Comments
 (0)