Skip to content

Commit 6e6b6b9

Browse files
committed
[Mangler] Only mangle new requirements for constrained extensions.
Rather than mangling the complete generic signature of a constrained extension, only mangle the requirements not already satisfied by the nominal type. For example, given: extension Dictionary where Value: Equatable { // OLD: _T0s10DictionaryV2t3s8HashableRzs9EquatableR_r0_lE3baryyF // NEW: _T0s10DictionaryV2t3s9EquatableR_rlE3baryyF public func bar() { } } In the existing mangling, we mangle the `Key: Hashable` requirement that’s part of the generic signature. With this change, we only mangle the new requirement (`Value: Equatable`). This is a win for constrained extensions *except* in the case of a constrained extension of a nominal type with a single, unconstrained generic parameter: extension Array where Element: Equatable { // OLD: _T0Sa2t3s9EquatableRzlE3baryyF // NEW would be: _T0Sa2t3s9EquatableRzrlE3baryyF public func bar() { } } Check explicily for this shortcut mangling and fall back to the old path, so this change is a strict improvement.
1 parent c30bc08 commit 6e6b6b9

15 files changed

+107
-93
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,9 @@ void ASTMangler::appendContext(const DeclContext *ctx) {
13111311
appendModule(ExtD->getParentModule());
13121312
if (sig && ExtD->isConstrainedExtension()) {
13131313
Mod = ExtD->getModuleContext();
1314-
appendGenericSignature(sig);
1314+
auto nominalSig = ExtD->getAsNominalTypeOrNominalTypeExtensionContext()
1315+
->getGenericSignatureOfContext();
1316+
appendGenericSignature(sig, nominalSig);
13151317
}
13161318
return appendOperator("E");
13171319
}
@@ -1566,16 +1568,30 @@ bool ASTMangler::appendGenericSignature(const GenericSignature *sig,
15661568
--firstParam;
15671569
genericParams = genericParams.slice(firstParam);
15681570

1569-
for (auto &reqt : canSig->getRequirements()) {
1570-
// If the requirement is satisfied by the context signature,
1571-
// we don't need to mangle it here.
1572-
if (contextSig->isRequirementSatisfied(reqt))
1573-
continue;
1574-
1575-
// Mangle the requirement.
1576-
requirementsBuffer.push_back(reqt);
1571+
// Special case: if we would be mangling zero generic parameters, but
1572+
// the context signature is a single, unconstrained generic parameter,
1573+
// it's better to mangle the complete canonical signature because we
1574+
// have a special-case mangling for that.
1575+
if (genericParams.empty() &&
1576+
contextSig->getGenericParams().size() == 1 &&
1577+
contextSig->getRequirements().empty()) {
1578+
initialParamDepth = 0;
1579+
genericParams = canSig->getGenericParams();
1580+
requirements = canSig->getRequirements();
1581+
} else {
1582+
// Otherwise, only include those requirements that aren't satisfied by the
1583+
// context signature.
1584+
for (auto &reqt : canSig->getRequirements()) {
1585+
// If the requirement is satisfied by the context signature,
1586+
// we don't need to mangle it here.
1587+
if (contextSig->isRequirementSatisfied(reqt))
1588+
continue;
1589+
1590+
// Mangle the requirement.
1591+
requirementsBuffer.push_back(reqt);
1592+
}
1593+
requirements = requirementsBuffer;
15771594
}
1578-
requirements = requirementsBuffer;
15791595
} else {
15801596
// Use the complete canonical signature.
15811597
initialParamDepth = 0;

lib/Demangling/Demangler.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,8 +1956,6 @@ NodePointer Demangler::demangleGenericSignature(bool hasParamCounts) {
19561956
Sig->addChild(createNode(Node::Kind::DependentGenericParamCount, 1),
19571957
*this);
19581958
}
1959-
if (Sig->getNumChildren() == 0)
1960-
return nullptr;
19611959
size_t NumCounts = Sig->getNumChildren();
19621960
while (NodePointer Req = popNode(isRequirement)) {
19631961
Sig->addChild(Req, *this);

test/IRGen/same_type_constraints.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public extension P where Foo == DefaultFoo<Self> {
1616
}
1717
}
1818

19-
// CHECK: define{{( protected)?}} swiftcc void @_T021same_type_constraints1PPA2aBRzAA10DefaultFooVyxG0E0RtzlE3fooAFyF
19+
// CHECK: define{{( protected)?}} swiftcc void @_T021same_type_constraints1PPA2A10DefaultFooVyxG0E0RtzrlE3fooAFyF
2020

2121
// <rdar://26873036> IRGen crash with derived class declaring same-type constraint on constrained associatedtype.
2222
public class C1<T: Equatable> { }

test/SILGen/constrained_extensions.swift

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ extension Array where Element == Int {
6464
}
6565

6666
extension Dictionary where Key == Int {
67-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lEABySiq_Gyt1x_tcfC : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> @owned Dictionary<Int, Value> {
67+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlEABySiq_Gyt1x_tcfC : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> @owned Dictionary<Int, Value> {
6868
public init(x: ()) {
6969
self.init()
7070
}
7171

72-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_vg : $@convention(method) <Key, Value where Key == Int> (@guaranteed Dictionary<Int, Value>) -> @out Value
73-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_vs : $@convention(method) <Key, Value where Key == Int> (@in Value, @inout Dictionary<Int, Value>) -> ()
74-
// CHECK-LABEL: sil shared [transparent] [serialized] @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_vmytfU_ : $@convention(method) <Key, Value where Key == Int> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Dictionary<Int, Value>, @thick Dictionary<Int, Value>.Type) -> ()
75-
// CHECK-LABEL: sil [transparent] [serialized] @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_vm : $@convention(method) <Key, Value where Key == Int> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Dictionary<Int, Value>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
72+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE16instancePropertyq_vg : $@convention(method) <Key, Value where Key == Int> (@guaranteed Dictionary<Int, Value>) -> @out Value
73+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE16instancePropertyq_vs : $@convention(method) <Key, Value where Key == Int> (@in Value, @inout Dictionary<Int, Value>) -> ()
74+
// CHECK-LABEL: sil shared [transparent] [serialized] @_T0s10DictionaryV22constrained_extensionsSiRszrlE16instancePropertyq_vmytfU_ : $@convention(method) <Key, Value where Key == Int> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Dictionary<Int, Value>, @thick Dictionary<Int, Value>.Type) -> ()
75+
// CHECK-LABEL: sil [transparent] [serialized] @_T0s10DictionaryV22constrained_extensionsSiRszrlE16instancePropertyq_vm : $@convention(method) <Key, Value where Key == Int> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Dictionary<Int, Value>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
7676
public var instanceProperty: Value {
7777
get {
7878
return self[0]!
@@ -82,49 +82,49 @@ extension Dictionary where Key == Int {
8282
}
8383
}
8484

85-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE14instanceMethodq_yF : $@convention(method) <Key, Value where Key == Int> (@guaranteed Dictionary<Int, Value>) -> @out Value
85+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE14instanceMethodq_yF : $@convention(method) <Key, Value where Key == Int> (@guaranteed Dictionary<Int, Value>) -> @out Value
8686
public func instanceMethod() -> Value {
8787
return instanceProperty
8888
}
8989

90-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE14instanceMethodq_q_1v_tF : $@convention(method) <Key, Value where Key == Int> (@in Value, @guaranteed Dictionary<Int, Value>) -> @out Value
90+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE14instanceMethodq_q_1v_tF : $@convention(method) <Key, Value where Key == Int> (@in Value, @guaranteed Dictionary<Int, Value>) -> @out Value
9191
public func instanceMethod(v: Value) -> Value {
9292
return v
9393
}
9494

95-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE12staticMethodSiyFZ : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> Int
95+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE12staticMethodSiyFZ : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> Int
9696
public static func staticMethod() -> Key {
9797
return staticProperty
9898
}
9999

100-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE14staticPropertySivgZ : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> Int
100+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE14staticPropertySivgZ : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> Int
101101
public static var staticProperty: Key {
102102
return 0
103103
}
104104

105-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE12staticMethodq_SiSg1k_q_Sg1vtFZfA_ : $@convention(thin) <Key, Value where Key == Int> () -> Optional<Int>
106-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE12staticMethodq_SiSg1k_q_Sg1vtFZfA0_ : $@convention(thin) <Key, Value where Key == Int> () -> @out Optional<Value>
107-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE12staticMethodq_SiSg1k_q_Sg1vtFZ : $@convention(method) <Key, Value where Key == Int> (Optional<Int>, @in Optional<Value>, @thin Dictionary<Int, Value>.Type) -> @out Value
105+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE12staticMethodq_SiSg1k_q_Sg1vtFZfA_ : $@convention(thin) <Key, Value where Key == Int> () -> Optional<Int>
106+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE12staticMethodq_SiSg1k_q_Sg1vtFZfA0_ : $@convention(thin) <Key, Value where Key == Int> () -> @out Optional<Value>
107+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE12staticMethodq_SiSg1k_q_Sg1vtFZ : $@convention(method) <Key, Value where Key == Int> (Optional<Int>, @in Optional<Value>, @thin Dictionary<Int, Value>.Type) -> @out Value
108108
public static func staticMethod(k: Key? = nil, v: Value? = nil) -> Value {
109109
return v!
110110
}
111111

112-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE17callsStaticMethodq_yFZ : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> @out Value
112+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE17callsStaticMethodq_yFZ : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> @out Value
113113
public static func callsStaticMethod() -> Value {
114114
return staticMethod()
115115
}
116116

117-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16callsConstructorq_yFZ : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> @out Value
117+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE16callsConstructorq_yFZ : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> @out Value
118118
public static func callsConstructor() -> Value {
119119
return Dictionary(x: ()).instanceMethod()
120120
}
121121

122-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lEq_yt_tcig : $@convention(method) <Key, Value where Key == Int> (@guaranteed Dictionary<Int, Value>) -> @out Value
122+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlEq_yt_tcig : $@convention(method) <Key, Value where Key == Int> (@guaranteed Dictionary<Int, Value>) -> @out Value
123123
public subscript(i: ()) -> Value {
124124
return self[0]!
125125
}
126126

127-
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE21inoutAccessOfPropertyyyF : $@convention(method) <Key, Value where Key == Int> (@inout Dictionary<Int, Value>) -> ()
127+
// CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszrlE21inoutAccessOfPropertyyyF : $@convention(method) <Key, Value where Key == Int> (@inout Dictionary<Int, Value>) -> ()
128128
public mutating func inoutAccessOfProperty() {
129129
func increment(x: inout Value) { }
130130

@@ -135,37 +135,37 @@ extension Dictionary where Key == Int {
135135
public class GenericClass<X, Y> {}
136136

137137
extension GenericClass where Y == () {
138-
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexvg : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> @out X
139-
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexvs : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
140-
// CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexvmytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
141-
// CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexvm : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
138+
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_rlE5valuexvg : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> @out X
139+
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_rlE5valuexvs : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
140+
// CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_rlE5valuexvmytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
141+
// CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_rlE5valuexvm : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
142142
public var value: X {
143143
get { while true {} }
144144
set {}
145145
}
146146

147-
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytvg : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> ()
148-
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytvs : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> ()
149-
// CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytvmytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
150-
// CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytvm : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
147+
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_rlE5emptyytvg : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> ()
148+
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_rlE5emptyytvs : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> ()
149+
// CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_rlE5emptyytvmytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
150+
// CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_rlE5emptyytvm : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
151151
public var empty: Y {
152152
get { return () }
153153
set {}
154154
}
155155

156-
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lExyt_tcig : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> @out X
157-
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lExyt_tcis : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
158-
// CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lExyt_tcimytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
159-
// CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lExyt_tcim : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
156+
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_rlExyt_tcig : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> @out X
157+
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_rlExyt_tcis : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
158+
// CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_rlExyt_tcimytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
159+
// CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_rlExyt_tcim : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
160160
public subscript(_: Y) -> X {
161161
get { while true {} }
162162
set {}
163163
}
164164

165-
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lEyxcig : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
166-
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lEyxcis : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
167-
// CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lEyxcimytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
168-
// CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lEyxcim : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @in X, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
165+
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_rlEyxcig : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
166+
// CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_rlEyxcis : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
167+
// CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_rlEyxcimytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
168+
// CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_rlEyxcim : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @in X, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
169169
public subscript(_: X) -> Y {
170170
get { while true {} }
171171
set {}

0 commit comments

Comments
 (0)