mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Frontend: Warn if adoption mode is requested but not supported
This commit is contained in:
@@ -831,6 +831,13 @@ static bool ParseEnabledFeatureArgs(LangOptions &Opts, ArgList &Args,
|
||||
/*didYouMean=*/validModeName);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isFeatureAdoptable(*feature)) {
|
||||
Diags.diagnose(SourceLoc(),
|
||||
diag::feature_does_not_support_adoption_mode,
|
||||
featureName);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// `-disable-*-feature` flags do not support a mode specifier.
|
||||
Diags.diagnose(SourceLoc(), diag::cannot_disable_feature_with_mode,
|
||||
|
||||
Reference in New Issue
Block a user