mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Basic] hasFeature should succeed for promoted language features
Merge `$<Feature>` and `hasFeature` implementations.
- `$<Feature>` did not support upcoming language features.
- `hasFeature` did not support promoted language features and also
didn't take into account `Options` in `Features.def`.
Remove `Options` entirely, it was always one of three cases:
- `true`
- `langOpts.hasFeature`
- `hasSwiftSwiftParser`
Since `LangOptions::hasFeature` should always be used anyway, it's no
longer necessary. `hasSwiftSwiftParser` can be special cased when adding
the default promoted language features (by removing those features).
Resolves rdar://117917456.
This commit is contained in:
@@ -153,7 +153,7 @@ struct ASTGenExecutor {
|
||||
symbolgraphgen::SymbolGraphOptions symbolOpts;
|
||||
|
||||
// Enable ASTGen.
|
||||
langOpts.Features.insert(Feature::ParserASTGen);
|
||||
langOpts.enableFeature(Feature::ParserASTGen);
|
||||
|
||||
std::unique_ptr<ASTContext> ctx(
|
||||
ASTContext::get(langOpts, typeckOpts, silOpts, searchPathOpts,
|
||||
|
||||
Reference in New Issue
Block a user