File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ bool StringOptimization::optimizeTypeName(ApplyInst *typeNameCall) {
300300
301301 auto metatype = metatypeInst->getType ().getAs <MetatypeType>();
302302 Type ty = metatype->getInstanceType ();
303- if (ty->hasArchetype ())
303+ if (ty->hasArchetype () || ty-> hasDynamicSelfType () )
304304 return false ;
305305
306306 // Usually the "qualified" parameter of _typeName() is a constant boolean.
Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ struct Outer {
2222 static let staticString = " static "
2323}
2424
25+ class C {
26+ @inline ( never)
27+ func f( ) -> String {
28+ return " \( Self . self) "
29+ }
30+ }
31+
2532// More types are tested in test/stdlib/TypeName.swift and
2633// test/stdlib/TypeNameInterpolation.swift
2734
@@ -149,6 +156,9 @@ printEmbeeded(testQualifiedLocalType())
149156// CHECK-OUTPUT: <test.Outer.InnerClass>
150157printEmbeeded ( testInnerClass ( ) )
151158
159+ // CHECK-OUTPUT: <C>
160+ printEmbeeded ( C ( ) . f ( ) )
161+
152162#if _runtime(_ObjC)
153163
154164// Can't use check-output here, because for non ObjC runtimes it would not match.
You can’t perform that action at this time.
0 commit comments