mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: Update resolveType() for subclass existentials
If the -enable-experimental-subclass-existentials staging flag is on, resolveType() now allows protocol compositions to contain class types. It also diagnoses if a composition has more than one superclass requirement. Also, change diagnostics that talked about 'protocol composition' to 'protocol-constrained type'. Since such types can now contain a superclass constraint, it's not correct to call them protocol composition. "Protocol-constrained type" isn't quite accurate either because 'Any' has no protocols, and 'AnyObject' will have no protocols but a general class constraint; but those are edge cases which won't come up in these diagnostics.
This commit is contained in:
@@ -871,6 +871,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
Opts.EnableExperimentalPropertyBehaviors |=
|
||||
Args.hasArg(OPT_enable_experimental_property_behaviors);
|
||||
|
||||
Opts.EnableExperimentalSubclassExistentials |=
|
||||
Args.hasArg(OPT_enable_experimental_subclass_existentials);
|
||||
|
||||
Opts.EnableClassResilience |=
|
||||
Args.hasArg(OPT_enable_class_resilience);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user