If the extension adds conformance to an invertible protocol, it's
confusing for people to also infer conditional requirements on the
generic parameters for those invertible protocols. This came up in the
review of SE-427.
Removing the old, ad-hoc diagnostics code improves the diagnostics we
emit, since the existing diagnostics for missing conformances is already
pretty good.
rdar://127369509
It doesn't really make sense for a conditional conformance requirement
for `Copyable` to depend on any other requirement other than other
`Copyable` conformance requirements.
resolves rdar://124967739
The model for associated types hasn't been fully worked-out for
noncopyable generics, but there is some support already that is being
used by the stdlib for an internal-only (and rather cursed) protocol
`_Pointer` to support `UnsafePointer`, etc.
This patch gates the existing experimental support for associated types
behind a feature flag. This flag doesn't emit feature-guards in
interfaces, since support for it is tied closely to NoncopyableGenerics
and has been there from its early days.
Noncopyable types were prevented from having failable initializers
because `Optional` itself didn't support noncopyable types. Now
`Optional` does, so lift this restriction and add a test.
This changes the minimized signature in a very narrow edge case.
If you have
class C : P {}
and also
protocol P : C {}
protocol P where Self : C {}
then <T where T : P, T : C> now becomes <T : P> both with spellings;
before, the first one gave <T : P> and the second <T : C>.
- Pass down the TypeResolution instance so we can get the generic
signature. This ensures we always use the correct signature in
SIL mode.
- Don't diagnose if the type contains error types.
The checking for ExistentialAny diagnostics needed to be updated to both
handle the new Copyable/Escapable protocols that appear in the Any and
AnyObject existential layouts.
resolves rdar://123332844
If we fail to build a generic signature (or requirement signature of a
protocol) because of a request cycle or because Knuth-Bendix completion
failed, we would create a placeholder signature with no requirements.
However in a move-only world, a completely unconstrained generic
parameter might generate spurious diagnostics when used in a copyable
way. For this reason, let's outfit these placeholder signatures with
a default set of conformance requirements to Copyable and Escapable.