File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -3564,9 +3564,14 @@ bool ArchetypeType::requiresClass() const {
3564
3564
Type ArchetypeType::getNestedType (AssociatedTypeDecl *assocType) {
3565
3565
Type interfaceType = getInterfaceType ();
3566
3566
Type memberInterfaceType =
3567
- DependentMemberType::get (interfaceType, assocType->getName ());
3568
- return getGenericEnvironment ()->getOrCreateArchetypeFromInterfaceType (
3569
- memberInterfaceType);
3567
+ DependentMemberType::get (interfaceType, assocType);
3568
+ auto genericSig = getGenericEnvironment ()->getGenericSignature ();
3569
+ if (genericSig->isValidTypeParameter (memberInterfaceType)) {
3570
+ return getGenericEnvironment ()->getOrCreateArchetypeFromInterfaceType (
3571
+ memberInterfaceType);
3572
+ }
3573
+
3574
+ return Type ();
3570
3575
}
3571
3576
3572
3577
Type ArchetypeType::getNestedTypeByName (Identifier name) {
You can’t perform that action at this time.
0 commit comments