File tree Expand file tree Collapse file tree 5 files changed +18
-5
lines changed Expand file tree Collapse file tree 5 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -308,6 +308,9 @@ SwiftMangledName SwiftMangler::visitTypeAliasType(const swift::TypeAliasType* ty
308
308
309
309
SwiftMangledName SwiftMangler::visitArchetypeType (const swift::ArchetypeType* type) {
310
310
auto ret = initMangled (type) << fetch (type->getInterfaceType ());
311
+ if (const auto super = type->getSuperclass ()) {
312
+ ret << ' :' << fetch (super);
313
+ }
311
314
for (const auto * protocol : type->getConformsTo ()) {
312
315
// Including the protocols in the mangled name allows us to distinguish the "same" type in
313
316
// different extensions, where it might have different constraints. Mangling the context (i.e.
Original file line number Diff line number Diff line change 1
1
| Base | getName: | Base | getCanonicalType: | Base | getInterfaceType: | Base | hasSuperclass: | no | getNumberOfProtocols: | 1 |
2
2
| Base | getName: | Base | getCanonicalType: | Base | getInterfaceType: | Base | hasSuperclass: | no | getNumberOfProtocols: | 1 |
3
+ | Base | getName: | Base | getCanonicalType: | Base | getInterfaceType: | Base | hasSuperclass: | yes | getNumberOfProtocols: | 0 |
4
+ | Base | getName: | Base | getCanonicalType: | Base | getInterfaceType: | Base | hasSuperclass: | yes | getNumberOfProtocols: | 0 |
3
5
| Param | getName: | Param | getCanonicalType: | Param | getInterfaceType: | Param | hasSuperclass: | no | getNumberOfProtocols: | 0 |
4
6
| ParamWithProtocols | getName: | ParamWithProtocols | getCanonicalType: | ParamWithProtocols | getInterfaceType: | ParamWithProtocols | hasSuperclass: | no | getNumberOfProtocols: | 2 |
5
7
| ParamWithSuperclass | getName: | ParamWithSuperclass | getCanonicalType: | ParamWithSuperclass | getInterfaceType: | ParamWithSuperclass | hasSuperclass: | yes | getNumberOfProtocols: | 0 |
Original file line number Diff line number Diff line change 1
- | Base | 0 | primary_archetypes.swift:3 :1:3 :13 | P |
2
- | Base | 0 | primary_archetypes.swift:4 :1:4 :14 | P2 |
1
+ | Base | 0 | primary_archetypes.swift:4 :1:4 :13 | P |
2
+ | Base | 0 | primary_archetypes.swift:5 :1:5 :14 | P2 |
3
3
| ParamWithProtocols | 0 | file://:0:0:0:0 | Equatable |
4
- | ParamWithProtocols | 1 | primary_archetypes.swift:3 :1:3 :13 | P |
4
+ | ParamWithProtocols | 1 | primary_archetypes.swift:4 :1:4 :13 | P |
5
5
| ParamWithSuperclassAndProtocols | 0 | file://:0:0:0:0 | Equatable |
6
- | ParamWithSuperclassAndProtocols | 1 | primary_archetypes.swift:3 :1:3 :13 | P |
6
+ | ParamWithSuperclassAndProtocols | 1 | primary_archetypes.swift:4 :1:4 :13 | P |
Original file line number Diff line number Diff line change
1
+ | Base | S |
2
+ | Base | S2 |
1
3
| ParamWithSuperclass | S |
2
4
| ParamWithSuperclassAndProtocols | S |
Original file line number Diff line number Diff line change 1
1
class S { }
2
+ class S2 { }
2
3
3
4
protocol P { }
4
5
protocol P2 { }
@@ -13,7 +14,12 @@ class Generic<Base> {}
13
14
extension Generic where Base : P {
14
15
func f( _: Base ) { }
15
16
}
16
-
17
17
extension Generic where Base : P2 {
18
18
func f( _: Base ) { }
19
19
}
20
+ extension Generic where Base : S {
21
+ func f( _: Base ) { }
22
+ }
23
+ extension Generic where Base : S2 {
24
+ func f( _: Base ) { }
25
+ }
You can’t perform that action at this time.
0 commit comments