@@ -599,6 +599,17 @@ void IRGenFunction::setScopedLocalTypeData(LocalTypeDataKey key,
599599
600600 getOrCreateLocalTypeData ().addConcrete (getActiveDominancePoint (),
601601 isConditional, key, value);
602+
603+ // We query reified types in places so also put a key mapping in for them.
604+ auto reified = IGM.getRuntimeReifiedType (key.Type );
605+ if (reified != key.Type ) {
606+ auto reifiedKey = LocalTypeDataKey (reified, key.Kind );
607+ if (isConditional) {
608+ registerConditionalLocalTypeDataKey (reifiedKey);
609+ }
610+ getOrCreateLocalTypeData ().addConcrete (getActiveDominancePoint (),
611+ isConditional, reifiedKey, value);
612+ }
602613}
603614
604615void IRGenFunction::setUnscopedLocalTypeMetadata (CanType type,
@@ -627,6 +638,15 @@ void IRGenFunction::setUnscopedLocalTypeData(LocalTypeDataKey key,
627638
628639 getOrCreateLocalTypeData ().addConcrete (DominancePoint::universal (),
629640 /* conditional*/ false , key, value);
641+
642+ // We query reified types in places so also put a key mapping in for them.
643+ auto reified = IGM.getRuntimeReifiedType (key.Type );
644+ if (reified != key.Type ) {
645+ auto reifiedKey = LocalTypeDataKey (reified, key.Kind );
646+ getOrCreateLocalTypeData ().addConcrete (DominancePoint::universal (),
647+ /* conditional*/ false , reifiedKey,
648+ value);
649+ }
630650}
631651
632652void IRGenFunction::bindLocalTypeDataFromTypeMetadata (CanType type,
0 commit comments