Skip to content

Commit 03a8567

Browse files
committed
[Sema] Fix storage of availability macros definition for SourceKit
rdar://72356584
1 parent 3135b5d commit 03a8567

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ namespace swift {
116116
std::string RequireExplicitAvailabilityTarget;
117117

118118
// Availability macros definitions to be expanded at parsing.
119-
SmallVector<StringRef, 4> AvailabilityMacros;
119+
SmallVector<std::string, 4> AvailabilityMacros;
120120

121121
/// If false, '#file' evaluates to the full path rather than a
122122
/// human-readable string.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %sourcekitd-test -req=sema %s -- %s \
2+
// RUN: -Xfrontend -define-availability \
3+
// RUN: -Xfrontend "_iOS8Aligned:macOS 10.10, iOS 8.0" | %FileCheck %s
4+
5+
// REQUIRES: OS=macosx
6+
7+
@available(_iOS8Aligned, *)
8+
public func onMacOS10_10() {}
9+
// CHECK-NOT: key.line: 7,
10+
11+
@available(_iOS9Aligned, *)
12+
public func onMacOS10_11() {}
13+
// CHECK: key.line: 11,
14+
// CHECK: key.column: 26,
15+
// CHECK: key.description: "expected 'available' option such as 'unavailable', 'introduced', 'deprecated', 'obsoleted', 'message', or 'renamed'",

0 commit comments

Comments
 (0)