If they're considered explicit, requirement inference will complain when
it infers X: SomeProtocol for some concrete type X.
Fixes SR-4693, rdar://problem/31819616
When asking a substitution map for a conformance, it's okay if the
conformance isn't there---just detect this case and return None.
Also, collapse a redundant testcase Huon noted.
When we are checking the conformance of a nominal type to a particular
protocol, we check each of the requirements in the requirement
signature, substituting in our Self type and (by extension) type
witnesses. However, when we're trying to fulfill requirements for
associated types (which might be mapped to concrete types), perform
the conformance lookup in the module of the conformance itself---not
the SubstitutionMap, which can't possibly have them at this point.
Fixes rdar://problem/31041997.
When substituting a type like T.A.B where A and B are
associated types and the conformance requirement on T.A
is implied by conformance requirements on T, we would
crash.
The problem is that we have no way of representing an
abstract conformance with nested concrete types.
This patch adds a workaround that we can live with until
ConformanceAccessPaths are plumbed through all the way.
Fixes <rdar://problem/30737546> and
<https://bugs.swift.org/browse/SR-3500>.
Possibly fixes <rdar://problem/31334245>.