@@ -2612,19 +2612,19 @@ void irgen::bindGenericRequirement(IRGenFunction &IGF,
2612
2612
GenericRequirement requirement,
2613
2613
llvm::Value *value,
2614
2614
GetTypeParameterInContextFn getInContext) {
2615
- // Get the corresponding context archetype .
2616
- auto archetype = cast<ArchetypeType>( getInContext (requirement.TypeParameter ) );
2615
+ // Get the corresponding context type .
2616
+ auto type = getInContext (requirement.TypeParameter );
2617
2617
2618
2618
if (auto proto = requirement.Protocol ) {
2619
+ assert (isa<ArchetypeType>(type));
2619
2620
assert (value->getType () == IGF.IGM .WitnessTablePtrTy );
2620
- setProtocolWitnessTableName (IGF.IGM , value, archetype , proto);
2621
+ setProtocolWitnessTableName (IGF.IGM , value, type , proto);
2621
2622
auto kind = LocalTypeDataKind::forAbstractProtocolWitnessTable (proto);
2622
- IGF.setUnscopedLocalTypeData (archetype , kind, value);
2623
+ IGF.setUnscopedLocalTypeData (type , kind, value);
2623
2624
} else {
2624
2625
assert (value->getType () == IGF.IGM .TypeMetadataPtrTy );
2625
- setTypeMetadataName (IGF.IGM , value, archetype);
2626
- auto kind = LocalTypeDataKind::forTypeMetadata ();
2627
- IGF.setUnscopedLocalTypeData (archetype, kind, value);
2626
+ setTypeMetadataName (IGF.IGM , value, type);
2627
+ IGF.bindLocalTypeDataFromTypeMetadata (type, IsExact, value);
2628
2628
}
2629
2629
}
2630
2630
0 commit comments