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) {
300
300
301
301
auto metatype = metatypeInst->getType ().getAs <MetatypeType>();
302
302
Type ty = metatype->getInstanceType ();
303
- if (ty->hasArchetype ())
303
+ if (ty->hasArchetype () || ty-> hasDynamicSelfType () )
304
304
return false ;
305
305
306
306
// 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 {
22
22
static let staticString = " static "
23
23
}
24
24
25
+ class C {
26
+ @inline ( never)
27
+ func f( ) -> String {
28
+ return " \( Self . self) "
29
+ }
30
+ }
31
+
25
32
// More types are tested in test/stdlib/TypeName.swift and
26
33
// test/stdlib/TypeNameInterpolation.swift
27
34
@@ -149,6 +156,9 @@ printEmbeeded(testQualifiedLocalType())
149
156
// CHECK-OUTPUT: <test.Outer.InnerClass>
150
157
printEmbeeded ( testInnerClass ( ) )
151
158
159
+ // CHECK-OUTPUT: <C>
160
+ printEmbeeded ( C ( ) . f ( ) )
161
+
152
162
#if _runtime(_ObjC)
153
163
154
164
// 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