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,
79
79
}
80
80
81
81
#ifndef NDEBUG
82
- if (! archetype->getParent ()) {
82
+ if (archetype->isRoot ()) {
83
83
llvm::errs () << " Metadata for archetype not bound in function.\n "
84
84
<< " The metadata could be missing entirely because it needs "
85
85
" to be passed to the function.\n "
@@ -98,12 +98,12 @@ irgen::emitArchetypeTypeMetadataRef(IRGenFunction &IGF,
98
98
}
99
99
#endif
100
100
// 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>( );
102
102
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 ());
107
107
108
108
MetadataResponse response =
109
109
emitAssociatedTypeMetadataRef (IGF, parent, association, request);
You can’t perform that action at this time.
0 commit comments