File tree Expand file tree Collapse file tree 3 files changed +27
-15
lines changed Expand file tree Collapse file tree 3 files changed +27
-15
lines changed Original file line number Diff line number Diff line change @@ -64,12 +64,14 @@ namespace {
6464bool isUnavailableOrObsoleted (const Decl *D) {
6565 if (const auto *Avail =
6666 D->getAttrs ().getUnavailable (D->getASTContext ())) {
67- switch (Avail->getVersionAvailability (D->getASTContext ())) {
68- case AvailableVersionComparison::Unavailable:
69- case AvailableVersionComparison::Obsoleted:
70- return true ;
71- default :
72- break ;
67+ if (Avail->Platform != PlatformKind::none) {
68+ switch (Avail->getVersionAvailability (D->getASTContext ())) {
69+ case AvailableVersionComparison::Unavailable:
70+ case AvailableVersionComparison::Obsoleted:
71+ return true ;
72+ default :
73+ break ;
74+ }
7375 }
7476 }
7577 return false ;
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: %target-build-swift %s -module-name PlatformAgnostic -emit-module -emit-module-path %t/
3+ // RUN: %target-swift-symbolgraph-extract -module-name PlatformAgnostic -I %t -pretty-print -output-dir %t
4+
5+ // RUN: %FileCheck %s --input-file %t/PlatformAgnostic.symbols.json --check-prefix CHECK-FS
6+ // RUN: %FileCheck %s --input-file %t/PlatformAgnostic.symbols.json --check-prefix CHECK-FP
7+ // RUN: %FileCheck %s --input-file %t/PlatformAgnostic.symbols.json --check-prefix CHECK-SO
8+
9+ // CHECK-FS: FutureSwift
10+ @available ( swift 99 )
11+ public struct FutureSwift { }
12+
13+ // CHECK-FP: FuturePackage
14+ @available ( _PackageDescription 99 )
15+ public struct FuturePackage { }
16+
17+ // CHECK-SO: SwiftObsolete
18+ @available ( swift, obsoleted: 1.0 )
19+ public struct SwiftObsolete { }
Original file line number Diff line number Diff line change @@ -25,13 +25,4 @@ extension ShouldAppear {
2525 public func shouldntAppear2( ) { }
2626}
2727
28- // CHECK-NOT: SwiftObsoleted
29- @available ( swift, obsoleted: 1.0 )
30- public struct SwiftObsoleted { }
31-
32- @available ( swift, obsoleted: 1.0 )
33- extension ShouldAppear {
34- public func shouldntAppear3( ) { }
35- }
36-
3728// CHECK-NOT: shouldntAppear
You can’t perform that action at this time.
0 commit comments