Skip to content

Commit 5404ccb

Browse files
committed
[NFC] Remove "Runtime" from this feature name to avoid confusion
1 parent 555a526 commit 5404ccb

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

include/swift/AST/FeatureAvailability.def

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
/// FEATURE(N, V)
1919
/// N - The name of the feature (in UpperCamelCase).
2020
/// V - The Swift version number, as a tuple, or FUTURE.
21+
///
22+
/// The feature Foo turns into two methods on ASTContext:
23+
/// getFooRuntimeAvailability(), which returns the exact version provided
24+
/// here, and getFooAvailability(), which maps that version into a version
25+
/// of the target OS. Because both of these methods exist, it is a bad idea
26+
/// to use a feature name that ends in "Runtime", or people might get very
27+
/// confused.
2128
#ifndef FEATURE
2229
#define FEATURE(N, V)
2330
#endif
@@ -48,7 +55,8 @@ FEATURE(Concurrency, (5, 5))
4855
FEATURE(MultiPayloadEnumTagSinglePayload, (5, 6))
4956
FEATURE(ObjCIsUniquelyReferenced, (5, 6))
5057

51-
FEATURE(ParameterizedExistentialRuntime, (5, 7))
58+
// Metadata and casting support for parameterized existential types
59+
FEATURE(ParameterizedExistential, (5, 7))
5260

5361
FEATURE(VariadicGenericType, (5, 9))
5462
FEATURE(SignedConformsToProtocol, (5, 9))

lib/IRGen/IRGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ namespace RuntimeConstants {
960960
}
961961

962962
RuntimeAvailability ParameterizedExistentialAvailability(ASTContext &Context) {
963-
auto featureAvailability = Context.getParameterizedExistentialRuntimeAvailability();
963+
auto featureAvailability = Context.getParameterizedExistentialAvailability();
964964
if (!isDeploymentAvailabilityContainedIn(Context, featureAvailability)) {
965965
return RuntimeAvailability::ConditionallyAvailable;
966966
}

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2988,7 +2988,7 @@ bool swift::diagnoseParameterizedProtocolAvailability(
29882988
SourceRange ReferenceRange, const DeclContext *ReferenceDC) {
29892989
return TypeChecker::checkAvailability(
29902990
ReferenceRange,
2991-
ReferenceDC->getASTContext().getParameterizedExistentialRuntimeAvailability(),
2991+
ReferenceDC->getASTContext().getParameterizedExistentialAvailability(),
29922992
diag::availability_parameterized_protocol_only_version_newer,
29932993
ReferenceDC);
29942994
}

0 commit comments

Comments
 (0)