Skip to content

Commit 4909b9b

Browse files
committed
[Frontend] SupportedFeatures: print "enabled_in" as a string
This is future-proofing the version part of the upcoming feature. There currently no features that require that but it's possible that they'd be added in the future.
1 parent 3547ba5 commit 4909b9b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Basic/SupportedFeatures.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void printSupportedFeatures(llvm::raw_ostream &out) {
5252
out << ", \"migratable\": true";
5353
}
5454
if (auto version = feature.getLanguageVersion()) {
55-
out << ", \"enabled_in\": " << *version;
55+
out << ", \"enabled_in\": \"" << *version << "\"";
5656
}
5757
out << " }";
5858
};
@@ -71,4 +71,4 @@ void printSupportedFeatures(llvm::raw_ostream &out) {
7171
}
7272

7373
} // end namespace features
74-
} // end namespace swift
74+
} // end namespace swift

test/Frontend/print-supported-features.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// CHECK: "features": {
44
// CHECK-NEXT: "upcoming": [
5-
// CHECK: { "name": "{{.*}}"{{, "migratable": true}}, "enabled_in": {{[0-9]+}} }
5+
// CHECK: { "name": "{{.*}}"{{, "migratable": true}}, "enabled_in": "{{.*}}" }
66
// CHECK: ],
77
// CHECK-NEXT: "experimental": [
88
// CHECK: { "name": "{{.*}}"{{, "migratable": true}} }

0 commit comments

Comments
 (0)