File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -3590,6 +3590,12 @@ void AttributeChecker::visitAbstractSpecializeAttr(AbstractSpecializeAttr *attr)
35903590 }
35913591
35923592 (void )attr->getSpecializedSignature (FD);
3593+
3594+ // Force resolution of interface types written in requirements here to check
3595+ // that generic types satisfy generic requirements, and so on.
3596+ WhereClauseOwner (FD, attr)
3597+ .visitRequirements (TypeResolutionStage::Interface,
3598+ [](Requirement, RequirementRepr *) { return false ; });
35933599}
35943600
35953601GenericSignature
Original file line number Diff line number Diff line change @@ -602,7 +602,8 @@ static void checkGenericParams(GenericContext *ownerCtx) {
602602 checkInheritanceClause (gp);
603603 }
604604
605- // Force resolution of interface types written in requirements here.
605+ // Force resolution of interface types written in requirements here to check
606+ // that generic types satisfy generic requirements, and so on.
606607 WhereClauseOwner (ownerCtx)
607608 .visitRequirements (TypeResolutionStage::Interface,
608609 [](Requirement, RequirementRepr *) { return false ; });
Original file line number Diff line number Diff line change @@ -405,3 +405,9 @@ func nonGenericParam2(x: Int) {}
405405@_specialize ( where T == Int)
406406@_specialize ( where T == Int)
407407func genericParamDuplicate< T> ( t: T ) { }
408+
409+ struct GG < T: P > { }
410+
411+ // expected-error@+1 {{type 'String' does not conform to protocol 'P'}}
412+ @_specialize ( where T == GG< String> )
413+ func genericArgInvalidSpecialize< T> ( t: T ) { }
You can’t perform that action at this time.
0 commit comments