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 {
35643564Type ArchetypeType::getNestedType (AssociatedTypeDecl *assocType) {
35653565 Type interfaceType = getInterfaceType ();
35663566 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 ();
35703575}
35713576
35723577Type ArchetypeType::getNestedTypeByName (Identifier name) {
You can’t perform that action at this time.
0 commit comments