Skip to content

Commit d613cd9

Browse files
authored
Merge pull request swiftlang#31706 from nkcsgexi/62990671
ABIChecker: don't diagnose missing availability attribute for decls where the attribute doesn't apply
2 parents f3da784 + 9883e66 commit d613cd9

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,6 @@ open class AddingNewDesignatedInit {
244244

245245
public extension Float {
246246
func floatHigher() {}
247-
}
247+
}
248+
249+
infix operator <==> : AssignmentPrecedence

test/api-digester/Outputs/Cake-abi.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ cake: Accessor GlobalLetChangedToVar.Modify() is a new API without @available at
5353
cake: Accessor GlobalLetChangedToVar.Set() is a new API without @available attribute
5454
cake: Accessor fixedLayoutStruct2.BecomeFixedBinaryOrder.Modify() is a new API without @available attribute
5555
cake: Accessor fixedLayoutStruct2.BecomeFixedBinaryOrder.Set() is a new API without @available attribute
56-
cake: AssociatedType RequiementChanges.addedTypeWithDefault is a new API without @available attribute
57-
cake: AssociatedType RequiementChanges.addedTypeWithoutDefault is a new API without @available attribute
5856
cake: Class C0 is a new API without @available attribute
5957
cake: Class C5 is now without @objc
6058
cake: Class C8 is a new API without @available attribute

tools/swift-api-digester/swift-api-digester.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,8 @@ class PrunePass : public MatchedNodeListener, public SDKTreeDiffPass {
11451145
// Decls with @_alwaysEmitIntoClient aren't required to have an
11461146
// @available attribute.
11471147
if (!Ctx.getOpts().SkipOSCheck &&
1148+
DeclAttribute::canAttributeAppearOnDeclKind(DeclAttrKind::DAK_Available,
1149+
D->getDeclKind()) &&
11481150
!D->getIntroducingVersion().hasOSAvailability() &&
11491151
!D->hasDeclAttribute(DeclAttrKind::DAK_AlwaysEmitIntoClient)) {
11501152
D->emitDiag(D->getLoc(), diag::new_decl_without_intro);

0 commit comments

Comments
 (0)