File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed
Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,10 @@ std::string toFullyQualifiedProtocolNameString(const swift::ProtocolDecl &Protoc
8585}
8686
8787std::string toMangledTypeNameString (const swift::Type &Type) {
88- return Mangle::ASTMangler ().mangleTypeWithoutPrefix (Type->getCanonicalType ());
88+ auto PrintingType = Type;
89+ if (Type->hasArchetype ())
90+ PrintingType = Type->mapTypeOutOfContext ();
91+ return Mangle::ASTMangler ().mangleTypeWithoutPrefix (PrintingType->getCanonicalType ());
8992}
9093
9194} // namespace
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: echo "[MyProto]" > %t/protocols.json
3+
4+ // RUN: %target-swift-frontend -typecheck -emit-const-values-path %t/ExtractEnums.swiftconstvalues -const-gather-protocols-file %t/protocols.json -primary-file %s
5+ // RUN: cat %t/ExtractEnums.swiftconstvalues 2>&1 | %FileCheck %s
6+
7+ protocol MyProto { }
8+
9+ public struct Foo {
10+ init ( bar: Any ) {
11+ }
12+ }
13+
14+ public struct ArchetypalConformance < T> : MyProto {
15+ let baz : Foo = Foo ( bar: T . self)
16+ public init ( ) { }
17+ }
18+
19+ // CHECK: [
20+ // CHECK-NEXT: {
21+ // CHECK-NEXT: "typeName": "ExtractArchetype.ArchetypalConformance<T>"
22+ // CHECK: "valueKind": "InitCall",
23+ // CHECK-NEXT: "value": {
24+ // CHECK-NEXT: "type": "ExtractArchetype.Foo",
25+ // CHECK-NEXT: "arguments": [
26+ // CHECK-NEXT: {
27+ // CHECK-NEXT: "label": "bar",
28+ // CHECK-NEXT: "type": "Any",
29+ // CHECK-NEXT: "valueKind": "Type",
30+ // CHECK-NEXT: "value": {
31+ // CHECK-NEXT: "type": "T",
32+ // CHECK-NEXT: "mangledName": "x"
33+ // CHECK-NEXT: }
34+ // CHECK-NEXT: }
35+ // CHECK-NEXT: ]
36+ // CHECK-NEXT: }
You can’t perform that action at this time.
0 commit comments