StringOptimization: don't constant fold dynamic Self type names.

This wrongly results in "Self" instead of the real type name.

rdar://76113269
This commit is contained in:
Erik Eckstein
2021-04-02 08:40:44 +02:00
parent a5ecf8cf57
commit f3d1c34eb5
2 changed files with 11 additions and 1 deletions

View File

@@ -300,7 +300,7 @@ bool StringOptimization::optimizeTypeName(ApplyInst *typeNameCall) {
auto metatype = metatypeInst->getType().getAs<MetatypeType>();
Type ty = metatype->getInstanceType();
if (ty->hasArchetype())
if (ty->hasArchetype() || ty->hasDynamicSelfType())
return false;
// Usually the "qualified" parameter of _typeName() is a constant boolean.