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 @@ -382,7 +382,7 @@ getTypeRefImpl(IRGenModule &IGM,
382
382
useFlatUnique = true ;
383
383
break ;
384
384
385
- case MangledTypeRefRole::FieldMetadata:
385
+ case MangledTypeRefRole::FieldMetadata: {
386
386
// We want to keep fields of noncopyable type from being exposed to
387
387
// in-process runtime reflection libraries in older Swift runtimes, since
388
388
// they more than likely assume they can copy field values, and the language
@@ -391,11 +391,16 @@ getTypeRefImpl(IRGenModule &IGM,
391
391
// noncopyable, use a function to emit the type ref which will look for a
392
392
// signal from future runtimes whether they support noncopyable types before
393
393
// exposing their metadata to them.
394
- if (type->isNoncopyable ()) {
394
+ Type contextualTy = type;
395
+ if (sig)
396
+ contextualTy = sig.getGenericEnvironment ()->mapTypeIntoContext (type);
397
+
398
+ if (contextualTy->isNoncopyable ()) {
395
399
IGM.IRGen .noteUseOfTypeMetadata (type);
396
400
return getTypeRefByFunction (IGM, sig, type);
397
401
}
398
- LLVM_FALLTHROUGH;
402
+ }
403
+ LLVM_FALLTHROUGH;
399
404
400
405
case MangledTypeRefRole::DefaultAssociatedTypeWitness:
401
406
case MangledTypeRefRole::Metadata:
You can’t perform that action at this time.
0 commit comments