File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -631,6 +631,10 @@ class ASTContext final {
631
631
// / compiler for the target platform.
632
632
AvailabilityContext getSwift52Availability ();
633
633
634
+ // / Get the runtime availability of features that have been introduced in the
635
+ // / Swift compiler for future versions of the target platform.
636
+ AvailabilityContext getSwiftFutureAvailability ();
637
+
634
638
635
639
// ===--------------------------------------------------------------------===//
636
640
// Diagnostics Helper functions
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ AvailabilityContext ASTContext::getTypesInAbstractMetadataStateAvailability() {
243
243
}
244
244
245
245
AvailabilityContext ASTContext::getPrespecializedGenericMetadataAvailability () {
246
- return getSwift52Availability ();
246
+ return getSwiftFutureAvailability ();
247
247
}
248
248
249
249
AvailabilityContext ASTContext::getSwift52Availability () {
@@ -262,3 +262,20 @@ AvailabilityContext ASTContext::getSwift52Availability() {
262
262
return AvailabilityContext::alwaysAvailable ();
263
263
}
264
264
}
265
+
266
+ AvailabilityContext ASTContext::getSwiftFutureAvailability () {
267
+ auto target = LangOpts.Target ;
268
+
269
+ if (target.isMacOSX () ) {
270
+ return AvailabilityContext (
271
+ VersionRange::allGTE (llvm::VersionTuple (10 , 99 , 0 )));
272
+ } else if (target.isiOS ()) {
273
+ return AvailabilityContext (
274
+ VersionRange::allGTE (llvm::VersionTuple (99 , 0 , 0 )));
275
+ } else if (target.isWatchOS ()) {
276
+ return AvailabilityContext (
277
+ VersionRange::allGTE (llvm::VersionTuple (9 , 99 , 0 )));
278
+ } else {
279
+ return AvailabilityContext::alwaysAvailable ();
280
+ }
281
+ }
You can’t perform that action at this time.
0 commit comments