mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Frontend: Really allow any experimental feature when compiling a module interface.
The fix for https://github.com/apple/swift/pull/72632 was not sufficient because when modules are built from textual interface that happens in a sub-invocation which does not have typecheck-from-interface or compile-from-interface requested action. Instead of checking a requested action, set a language option to control whether non-production experimental features are allowed. Resolves rdar://125561443
This commit is contained in:
@@ -872,17 +872,14 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
// If this is a known experimental feature, allow it in +Asserts
|
||||
// (non-release) builds for testing purposes.
|
||||
if (auto feature = getExperimentalFeature(value)) {
|
||||
#ifdef NDEBUG
|
||||
if (!buildingFromInterface && !isFeatureAvailableInProduction(*feature)) {
|
||||
if (Opts.RestrictNonProductionExperimentalFeatures &&
|
||||
!isFeatureAvailableInProduction(*feature)) {
|
||||
Diags.diagnose(SourceLoc(), diag::experimental_not_supported_in_production,
|
||||
A->getValue());
|
||||
HadError = true;
|
||||
} else {
|
||||
Opts.enableFeature(*feature);
|
||||
}
|
||||
#else
|
||||
Opts.enableFeature(*feature);
|
||||
#endif
|
||||
|
||||
if (*feature == Feature::NoncopyableGenerics2)
|
||||
Opts.enableFeature(Feature::NoncopyableGenerics);
|
||||
|
||||
Reference in New Issue
Block a user