File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ irgen::emitArchetypeTypeMetadataRef(IRGenFunction &IGF,
7979 }
8080
8181#ifndef NDEBUG
82- if (! archetype->getParent ()) {
82+ if (archetype->isRoot ()) {
8383 llvm::errs () << " Metadata for archetype not bound in function.\n "
8484 << " The metadata could be missing entirely because it needs "
8585 " to be passed to the function.\n "
@@ -98,12 +98,12 @@ irgen::emitArchetypeTypeMetadataRef(IRGenFunction &IGF,
9898 }
9999#endif
100100 // If there's no local or opaque metadata, it must be a nested type.
101- assert ( archetype->getParent () && " Not a nested archetype " );
101+ auto *member = archetype->getInterfaceType ()-> castTo <DependentMemberType>( );
102102
103- CanArchetypeType parent (archetype-> getParent ());
104- AssociatedType association (
105- archetype-> getInterfaceType ()-> castTo <DependentMemberType>()
106- ->getAssocType ());
103+ auto parent = cast<ArchetypeType>(
104+ archetype-> getGenericEnvironment ()-> mapTypeIntoContext (
105+ member-> getBase ())-> getCanonicalType ());
106+ AssociatedType association (member ->getAssocType ());
107107
108108 MetadataResponse response =
109109 emitAssociatedTypeMetadataRef (IGF, parent, association, request);
You can’t perform that action at this time.
0 commit comments