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 @@ -614,7 +614,8 @@ static void checkGenericParams(GenericContext *ownerCtx) {
614614 checkInheritanceClause (gp);
615615 }
616616
617- // Force resolution of interface types written in requirements here.
617+ // Force resolution of interface types written in requirements here to check
618+ // that generic types satisfy generic requirements, and so on.
618619 WhereClauseOwner (ownerCtx)
619620 .visitRequirements (TypeResolutionStage::Interface,
620621 [](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