mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Flag -disable-infer-iuos: don't infer IUO type for untyped bindings
If this option is enabled, when generating potential bindings for a type variable, don't propagate IUO type. Instead try the optional type and the underlying type. This way, untyped bindings will not be given IUO type when they are initialized with exprs of IUO type.
This commit is contained in:
@@ -764,6 +764,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
Opts.WarnOmitNeedlessWords = Args.hasArg(OPT_warn_omit_needless_words);
|
||||
Opts.OmitNeedlessWords |= Args.hasArg(OPT_enable_omit_needless_words);
|
||||
Opts.StripNSPrefix = Args.hasArg(OPT_enable_strip_ns_prefix);
|
||||
if (Args.hasArg(OPT_disable_infer_iuos)) {
|
||||
Opts.InferIUOs = false;
|
||||
}
|
||||
|
||||
Opts.EnableThrowWithoutTry |= Args.hasArg(OPT_enable_throw_without_try);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user