-
Notifications
You must be signed in to change notification settings - Fork 439
Add a string-based initializer for ExperimentalFeatures
.
#2895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/// given name, or returns nil if the name is not recognized. | ||
public init?(name: String) { | ||
switch name { | ||
case "referenceBindings": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these feature names should match the experimental feature name in the compiler, which means that they will need to be manually specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I renamed the existing featureName
to documentationDescription
to better describe its purpose (and cleaned up a few of those strings), and then reused featureName
for the actual name from Features.def
.
355d2ce
to
461cfcc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one request for a release notes entry, otherwise LGTM.
|
||
/// Creates a new value representing the experimental feature with the | ||
/// given name, or returns nil if the name is not recognized. | ||
public init?(name: String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a release note entry for this new method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Tools (like swift-format) can use this to let users enable experimental features in the parser via interfaces like the command line, without having to handle the translation from string to option set themselves.
461cfcc
to
d141151
Compare
@swift-ci please test |
Tools (like swift-format) can use this to let users enable experimental features in the parser via interfaces like the command line, without having to handle the translation from string to option set themselves.