Skip to content

ABI checker: avoid diagnosing missing availability info for decls that are only explicitly available on visionOS #79463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/swift/APIDigester/ModuleAnalyzerNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,11 @@ struct PlatformIntroVersion {
StringRef ios;
StringRef tvos;
StringRef watchos;
StringRef visionos;
StringRef swift;
bool hasOSAvailability() const {
return !macos.empty() || !ios.empty() || !tvos.empty() || !watchos.empty();
return !macos.empty() || !ios.empty() || !tvos.empty() ||
!watchos.empty() || !visionos.empty();
}
};

Expand Down
1 change: 1 addition & 0 deletions include/swift/IDE/DigesterEnums.def
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ KEY_STRING(IntromacOS, intro_Macosx)
KEY_STRING(IntroiOS, intro_iOS)
KEY_STRING(IntrotvOS, intro_tvOS)
KEY_STRING(IntrowatchOS, intro_watchOS)
KEY_STRING(IntrovisionOS, intro_visionOS)
KEY_STRING(Introswift, intro_swift)
KEY_STRING(ObjCName, objc_name)
KEY_STRING(InitKind, init_kind)
Expand Down
3 changes: 2 additions & 1 deletion lib/APIDigester/ModuleAnalyzerNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ SDKNodeDecl::SDKNodeDecl(SDKNodeInitInfo Info, SDKNodeKind Kind)
SugaredGenericSig(Info.SugaredGenericSig),
FixedBinaryOrder(Info.FixedBinaryOrder),
introVersions({Info.IntromacOS, Info.IntroiOS, Info.IntrotvOS,
Info.IntrowatchOS, Info.Introswift}),
Info.IntrowatchOS, Info.IntrovisionOS, Info.Introswift}),
ObjCName(Info.ObjCName) {}

SDKNodeType::SDKNodeType(SDKNodeInitInfo Info, SDKNodeKind Kind):
Expand Down Expand Up @@ -1468,6 +1468,7 @@ SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, Decl *D):
IntroiOS(Ctx.getPlatformIntroVersion(D, PlatformKind::iOS)),
IntrotvOS(Ctx.getPlatformIntroVersion(D, PlatformKind::tvOS)),
IntrowatchOS(Ctx.getPlatformIntroVersion(D, PlatformKind::watchOS)),
IntrovisionOS(Ctx.getPlatformIntroVersion(D, PlatformKind::visionOS)),
Introswift(Ctx.getLanguageIntroVersion(D)),
ObjCName(Ctx.getObjcName(D)),
InitKind(Ctx.getInitKind(D)),
Expand Down
5 changes: 5 additions & 0 deletions test/api-digester/Inputs/cake_current/cake.swift
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ public class Zoo {
public func getCurrentAnimalInlinable() -> [some Animal] {
return [Dog()]
}

@available(visionOS 1.50.4, *)
public func getAnimailOnVision() -> [some Animal] {
return [Dog()]
}
}

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