@@ -1916,37 +1916,35 @@ bool GenericSignatureBuilder::addSameTypeRequirementToConcrete(
19161916 // Make sure the concrete type fulfills the requirements on the archetype.
19171917 // FIXME: Move later...
19181918 DenseMap<ProtocolDecl *, ProtocolConformanceRef> conformances;
1919- if (!Concrete->is <ArchetypeType>()) {
1920- CanType depTy = rep->getDependentType ({ }, /* allowUnresolved=*/ true )
1921- ->getCanonicalType ();
1922- for (auto &conforms : rep->getConformsTo ()) {
1923- auto protocol = conforms.first ;
1924- auto conformance =
1925- getLookupConformanceFn ()(depTy, Concrete,
1926- protocol->getDeclaredInterfaceType ()
1927- ->castTo <ProtocolType>());
1928- if (!conformance) {
1929- Diags.diagnose (Source->getLoc (),
1930- diag::requires_generic_param_same_type_does_not_conform,
1931- Concrete, protocol->getName ());
1932- return true ;
1933- }
1919+ CanType depTy = rep->getDependentType ({ }, /* allowUnresolved=*/ true )
1920+ ->getCanonicalType ();
1921+ for (auto &conforms : rep->getConformsTo ()) {
1922+ auto protocol = conforms.first ;
1923+ auto conformance =
1924+ getLookupConformanceFn ()(depTy, Concrete,
1925+ protocol->getDeclaredInterfaceType ()
1926+ ->castTo <ProtocolType>());
1927+ if (!conformance) {
1928+ Diags.diagnose (Source->getLoc (),
1929+ diag::requires_generic_param_same_type_does_not_conform,
1930+ Concrete, protocol->getName ());
1931+ return true ;
1932+ }
19341933
1935- conformances.insert ({protocol, *conformance});
1934+ conformances.insert ({protocol, *conformance});
19361935
1937- // Abstract conformances are acceptable for existential types.
1938- assert (conformance->isConcrete () || Concrete->isExistentialType ());
1936+ // Abstract conformances are acceptable for existential types.
1937+ assert (conformance->isConcrete () || Concrete->isExistentialType ());
19391938
1940- // Update the requirement source now that we know it's concrete.
1941- // FIXME: Bad concrete source info.
1942- auto concreteSource = Source->viaConcrete (*this ,
1943- conformance->isConcrete ()
1944- ? conformance->getConcrete ()
1945- : nullptr );
1946- updateRequirementSource (conforms.second , concreteSource);
1947- }
1939+ // Update the requirement source now that we know it's concrete.
1940+ // FIXME: Bad concrete source info.
1941+ auto concreteSource = Source->viaConcrete (*this ,
1942+ conformance->isConcrete ()
1943+ ? conformance->getConcrete ()
1944+ : nullptr );
1945+ updateRequirementSource (conforms.second , concreteSource);
19481946 }
1949-
1947+
19501948 // Record the requirement.
19511949 rep->ConcreteType = Concrete;
19521950
0 commit comments