Skip to content

Commit 8c6224b

Browse files
authored
Merge pull request #21927 from slavapestov/enum-element-trailing-closure-5.0
Fix enum element constructor call with trailing closure [5.0]
2 parents a303a07 + 1e8a0ba commit 8c6224b

File tree

4 files changed

+109
-75
lines changed

4 files changed

+109
-75
lines changed

lib/SILGen/SILGenExpr.cpp

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,9 +2285,13 @@ static void emitTupleShuffleExprInto(RValueEmitter &emitter,
22852285
// Map outer initializations into a tuple of inner initializations:
22862286
// - fill out the initialization elements with null
22872287
TupleInitialization innerTupleInit;
2288-
CanTupleType innerTuple =
2289-
cast<TupleType>(E->getSubExpr()->getType()->getCanonicalType());
2290-
innerTupleInit.SubInitializations.resize(innerTuple->getNumElements());
2288+
if (E->isSourceScalar()) {
2289+
innerTupleInit.SubInitializations.push_back(nullptr);
2290+
} else {
2291+
CanTupleType innerTuple =
2292+
cast<TupleType>(E->getSubExpr()->getType()->getCanonicalType());
2293+
innerTupleInit.SubInitializations.resize(innerTuple->getNumElements());
2294+
}
22912295

22922296
// Map all the outer initializations to their appropriate targets.
22932297
for (unsigned outerIndex = 0; outerIndex != outerInits.size(); outerIndex++) {
@@ -2305,14 +2309,20 @@ static void emitTupleShuffleExprInto(RValueEmitter &emitter,
23052309
#endif
23062310

23072311
// Emit the sub-expression into the tuple initialization we just built.
2308-
emitter.SGF.emitExprInto(E->getSubExpr(), &innerTupleInit);
2312+
if (E->isSourceScalar()) {
2313+
emitter.SGF.emitExprInto(E->getSubExpr(),
2314+
innerTupleInit.SubInitializations[0].get());
2315+
} else {
2316+
emitter.SGF.emitExprInto(E->getSubExpr(), &innerTupleInit);
2317+
}
23092318

23102319
outerTupleInit->finishInitialization(emitter.SGF);
23112320
}
23122321

23132322
RValue RValueEmitter::visitTupleShuffleExpr(TupleShuffleExpr *E,
23142323
SGFContext C) {
2315-
assert(!E->isSourceScalar());
2324+
// FIXME: Once we're no longer using this code path for enum element payloads,
2325+
// also assert that !E->isSourceScalar().
23162326
assert(!E->isResultScalar());
23172327

23182328
// If we're emitting into an initialization, we can try shuffling the
@@ -2326,7 +2336,11 @@ RValue RValueEmitter::visitTupleShuffleExpr(TupleShuffleExpr *E,
23262336

23272337
// Emit the sub-expression tuple and destructure it into elements.
23282338
SmallVector<RValue, 4> elements;
2329-
visit(E->getSubExpr()).extractElements(elements);
2339+
if (E->isSourceScalar()) {
2340+
elements.push_back(visit(E->getSubExpr()));
2341+
} else {
2342+
visit(E->getSubExpr()).extractElements(elements);
2343+
}
23302344

23312345
// Prepare a new tuple to hold the shuffled result.
23322346
RValue result(E->getType()->getCanonicalType());

test/SILGen/enum.swift

Lines changed: 58 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
2-
// RUN: %target-swift-emit-silgen -parse-stdlib -parse-as-library -enable-sil-ownership -module-name Swift %s | %FileCheck %s
3-
4-
precedencegroup AssignmentPrecedence { assignment: true }
5-
6-
enum Optional<Wrapped> {
7-
case none
8-
case some(Wrapped)
9-
}
1+
// RUN: %target-swift-emit-silgen -parse-as-library -enable-sil-ownership %s | %FileCheck %s
102

113
enum Boolish {
124
case falsy
135
case truthy
146
}
157

16-
// CHECK-LABEL: sil hidden @$ss13Boolish_casesyyF
8+
// CHECK-LABEL: sil hidden @$s4enum13Boolish_casesyyF
179
func Boolish_cases() {
1810
// CHECK: [[BOOLISH:%[0-9]+]] = metatype $@thin Boolish.Type
1911
// CHECK-NEXT: [[FALSY:%[0-9]+]] = enum $Boolish, #Boolish.falsy!enumelt
@@ -24,18 +16,16 @@ func Boolish_cases() {
2416
_ = Boolish.truthy
2517
}
2618

27-
struct Int {}
28-
2919
enum Optionable {
3020
case nought
3121
case mere(Int)
3222
}
3323

34-
// CHECK-LABEL: sil hidden @$ss16Optionable_casesyySiF
24+
// CHECK-LABEL: sil hidden @$s4enum16Optionable_casesyySiF
3525
func Optionable_cases(_ x: Int) {
3626

3727
// CHECK: [[METATYPE:%.*]] = metatype $@thin Optionable.Type
38-
// CHECK: [[FN:%.*]] = function_ref @$ss10OptionableO4mereyABSicABmF
28+
// CHECK: [[FN:%.*]] = function_ref @$s4enum10OptionableO4mereyACSicACmFTc
3929
// CHECK-NEXT: [[CTOR:%.*]] = apply [[FN]]([[METATYPE]])
4030
// CHECK-NEXT: destroy_value [[CTOR]]
4131
_ = Optionable.mere
@@ -45,13 +35,13 @@ func Optionable_cases(_ x: Int) {
4535
_ = Optionable.mere(x)
4636
}
4737

48-
// CHECK-LABEL: sil shared [transparent] [thunk] @$ss10OptionableO4mereyABSicABmF
49-
// CHECK: [[FN:%.*]] = function_ref @$ss10OptionableO4mereyABSicABmF
38+
// CHECK-LABEL: sil shared [transparent] [thunk] @$s4enum10OptionableO4mereyACSicACmF
39+
// CHECK: [[FN:%.*]] = function_ref @$s4enum10OptionableO4mereyACSicACmF
5040
// CHECK-NEXT: [[METHOD:%.*]] = partial_apply [callee_guaranteed] [[FN]](%0)
5141
// CHECK-NEXT: return [[METHOD]]
5242
// CHECK-NEXT: }
5343

54-
// CHECK-LABEL: sil shared [transparent] @$ss10OptionableO4mereyABSicABmF
44+
// CHECK-LABEL: sil shared [transparent] @$s4enum10OptionableO4mereyACSicACmF
5545
// CHECK: [[RES:%.*]] = enum $Optionable, #Optionable.mere!enumelt.1, %0 : $Int
5646
// CHECK-NEXT: return [[RES]] : $Optionable
5747
// CHECK-NEXT: }
@@ -65,11 +55,11 @@ enum AddressOnly {
6555
case phantom(S)
6656
}
6757

68-
// CHECK-LABEL: sil hidden @$ss17AddressOnly_casesyys1SVF
58+
// CHECK-LABEL: sil hidden @$s4enum17AddressOnly_casesyyAA1SVF
6959
func AddressOnly_cases(_ s: S) {
7060

7161
// CHECK: [[METATYPE:%.*]] = metatype $@thin AddressOnly.Type
72-
// CHECK: [[FN:%.*]] = function_ref @$ss11AddressOnlyO4mereyABs1P_pcABmF
62+
// CHECK: [[FN:%.*]] = function_ref @$s4enum11AddressOnlyO4mereyAcA1P_pcACmFTc
7363
// CHECK-NEXT: [[CTOR:%.*]] = apply [[FN]]([[METATYPE]])
7464
// CHECK-NEXT: destroy_value [[CTOR]]
7565
_ = AddressOnly.mere
@@ -105,29 +95,29 @@ func AddressOnly_cases(_ s: S) {
10595
// CHECK: return
10696
}
10797

108-
// CHECK-LABEL: sil shared [transparent] [thunk] @$ss11AddressOnlyO4mereyABs1P_pcABmF
109-
// CHECK: [[FN:%.*]] = function_ref @$ss11AddressOnlyO4mereyABs1P_pcABmF
98+
// CHECK-LABEL: sil shared [transparent] [thunk] @$s4enum11AddressOnlyO4mereyAcA1P_pcACmFTc
99+
// CHECK: [[FN:%.*]] = function_ref @$s4enum11AddressOnlyO4mereyAcA1P_pcACmF
110100
// CHECK-NEXT: [[METHOD:%.*]] = partial_apply [callee_guaranteed] [[FN]](%0)
111101
// CHECK-NEXT: // function_ref
112-
// CHECK-NEXT: [[CANONICAL_THUNK_FN:%.*]] = function_ref @$ss1P_ps11AddressOnlyOIegir_sAA_pACIegnr_TR : $@convention(thin) (@in_guaranteed P, @guaranteed @callee_guaranteed (@in P) -> @out AddressOnly) -> @out AddressOnly
102+
// CHECK-NEXT: [[CANONICAL_THUNK_FN:%.*]] = function_ref @$s4enum1P_pAA11AddressOnlyOIegir_AaB_pADIegnr_TR : $@convention(thin) (@in_guaranteed P, @guaranteed @callee_guaranteed (@in P) -> @out AddressOnly) -> @out AddressOnly
113103
// CHECK-NEXT: [[CANONICAL_THUNK:%.*]] = partial_apply [callee_guaranteed] [[CANONICAL_THUNK_FN]]([[METHOD]])
114104
// CHECK-NEXT: return [[CANONICAL_THUNK]] : $@callee_guaranteed (@in_guaranteed P) -> @out AddressOnly
115105
// CHECK-NEXT: }
116106

117-
// CHECK-LABEL: sil shared [transparent] @$ss11AddressOnlyO4mereyABs1P_pcABmF : $@convention
107+
// CHECK-LABEL: sil shared [transparent] @$s4enum11AddressOnlyO4mereyAcA1P_pcACmF : $@convention
118108
// CHECK: bb0([[ARG0:%.*]] : @trivial $*AddressOnly, [[ARG1:%.*]] : @trivial $*P, [[ARG2:%.*]] : @trivial $@thin AddressOnly.Type):
119109
// CHECK: [[RET_DATA:%.*]] = init_enum_data_addr [[ARG0]] : $*AddressOnly, #AddressOnly.mere!enumelt.1
120110
// CHECK-NEXT: copy_addr [take] [[ARG1]] to [initialization] [[RET_DATA]] : $*P
121111
// CHECK-NEXT: inject_enum_addr [[ARG0]] : $*AddressOnly, #AddressOnly.mere!enumelt.1
122112
// CHECK: return
123-
// CHECK-NEXT: } // end sil function '$ss11AddressOnlyO4mereyABs1P_pcABmF'
113+
// CHECK-NEXT: } // end sil function '$s4enum11AddressOnlyO4mereyAcA1P_pcACmF'
124114

125115
enum PolyOptionable<T> {
126116
case nought
127117
case mere(T)
128118
}
129119

130-
// CHECK-LABEL: sil hidden @$ss20PolyOptionable_casesyyxlF
120+
// CHECK-LABEL: sil hidden @$s4enum20PolyOptionable_casesyyxlF
131121
func PolyOptionable_cases<T>(_ t: T) {
132122

133123
// CHECK: [[METATYPE:%.*]] = metatype $@thin PolyOptionable<T>.Type
@@ -154,7 +144,7 @@ func PolyOptionable_cases<T>(_ t: T) {
154144

155145
// The substituted type is loadable and trivial here
156146

157-
// CHECK-LABEL: sil hidden @$ss32PolyOptionable_specialized_casesyySiF
147+
// CHECK-LABEL: sil hidden @$s4enum32PolyOptionable_specialized_casesyySiF
158148
func PolyOptionable_specialized_cases(_ t: Int) {
159149

160150
// CHECK: [[METATYPE:%.*]] = metatype $@thin PolyOptionable<Int>.Type
@@ -172,35 +162,35 @@ func PolyOptionable_specialized_cases(_ t: Int) {
172162

173163
// Regression test for a bug where temporary allocations created as a result of
174164
// tuple implosion were not deallocated in enum constructors.
175-
struct String { var ptr: Builtin.NativeObject }
165+
struct String { var ptr: AnyObject }
176166

177-
enum Foo { case A(P, String) }
167+
enum Foo { case a(P, String) }
178168

179-
// Curry Thunk for Foo.A(_:)
169+
// Curry Thunk for Foo.a(_:)
180170
//
181-
// CHECK-LABEL: sil shared [transparent] [thunk] @$ss3FooO1AyABs1P_p_SStcABmF
182-
// CHECK: [[FN:%.*]] = function_ref @$ss3FooO1AyABs1P_p_SStcABmF
171+
// CHECK-LABEL: sil shared [transparent] [thunk] @$s4enum3FooO1ayAcA1P_p_AA6StringVtcACmFTc
172+
// CHECK: [[FN:%.*]] = function_ref @$s4enum3FooO1ayAcA1P_p_AA6StringVtcACmF
183173
// CHECK-NEXT: [[METHOD:%.*]] = partial_apply [callee_guaranteed] [[FN]](%0)
184174
// CHECK-NEXT: // function_ref
185-
// CHECK-NEXT: [[CANONICAL_THUNK_FN:%.*]] = function_ref @$ss1P_pSSs3FooOIegixr_sAA_pSSACIegngr_TR : $@convention(thin) (@in_guaranteed P, @guaranteed String, @guaranteed @callee_guaranteed (@in P, @owned String) -> @out Foo) -> @out Foo
175+
// CHECK-NEXT: [[CANONICAL_THUNK_FN:%.*]] = function_ref @$s4enum1P_pAA6StringVAA3FooOIegixr_AaB_pAdFIegngr_TR : $@convention(thin) (@in_guaranteed P, @guaranteed String, @guaranteed @callee_guaranteed (@in P, @owned String) -> @out Foo) -> @out Foo
186176
// CHECK-NEXT: [[CANONICAL_THUNK:%.*]] = partial_apply [callee_guaranteed] [[CANONICAL_THUNK_FN]]([[METHOD]])
187177
// CHECK-NEXT: return [[CANONICAL_THUNK]]
188178
// CHECK-NEXT: }
189179

190-
// Foo.A(_:)
191-
// CHECK-LABEL: sil shared [transparent] @$ss3FooO1AyABs1P_p_SStcABmF
180+
// Foo.a(_:)
181+
// CHECK-LABEL: sil shared [transparent] @$s4enum3FooO1ayAcA1P_p_AA6StringVtcACmF
192182
// CHECK: bb0([[ARG0:%.*]] : @trivial $*Foo, [[ARG1:%.*]] : @trivial $*P, [[ARG2:%.*]] : @owned $String, [[ARG3:%.*]] : @trivial $@thin Foo.Type):
193-
// CHECK: [[PAYLOAD:%.*]] = init_enum_data_addr [[ARG0]] : $*Foo, #Foo.A!enumelt.1
183+
// CHECK: [[PAYLOAD:%.*]] = init_enum_data_addr [[ARG0]] : $*Foo, #Foo.a!enumelt.1
194184
// CHECK-NEXT: [[LEFT:%.*]] = tuple_element_addr [[PAYLOAD]] : $*(P, String), 0
195185
// CHECK-NEXT: [[RIGHT:%.*]] = tuple_element_addr [[PAYLOAD]] : $*(P, String), 1
196186
// CHECK-NEXT: copy_addr [take] [[ARG1]] to [initialization] [[LEFT]] : $*P
197187
// CHECK-NEXT: store [[ARG2]] to [init] [[RIGHT]]
198-
// CHECK-NEXT: inject_enum_addr [[ARG0]] : $*Foo, #Foo.A!enumelt.1
188+
// CHECK-NEXT: inject_enum_addr [[ARG0]] : $*Foo, #Foo.a!enumelt.1
199189
// CHECK: return
200-
// CHECK-NEXT: } // end sil function '$ss3FooO1AyABs1P_p_SStcABmF'
190+
// CHECK-NEXT: } // end sil function '$s4enum3FooO1ayAcA1P_p_AA6StringVtcACmF'
201191

202192
func Foo_cases() {
203-
_ = Foo.A
193+
_ = Foo.a
204194
}
205195

206196
enum Indirect<T> {
@@ -213,3 +203,33 @@ enum Indirect<T> {
213203
func makeIndirectEnum<T>(_ payload: T) -> Indirect<T> {
214204
return Indirect.payload((payload, other: payload))
215205
}
206+
207+
// https://bugs.swift.org/browse/SR-9675
208+
209+
enum TrailingClosureConcrete {
210+
case label(fn: () -> Int)
211+
case noLabel(() -> Int)
212+
case twoElementsLabel(x: Int, fn: () -> Int)
213+
case twoElementsNoLabel(_ x: Int, _ fn: () -> Int)
214+
}
215+
216+
func useTrailingClosureConcrete() {
217+
_ = TrailingClosureConcrete.label { 0 }
218+
_ = TrailingClosureConcrete.noLabel { 0 }
219+
_ = TrailingClosureConcrete.twoElementsLabel(x: 0) { 0 }
220+
_ = TrailingClosureConcrete.twoElementsNoLabel(0) { 0 }
221+
}
222+
223+
enum TrailingClosureGeneric<T> {
224+
case label(fn: () -> T)
225+
case noLabel(() -> T)
226+
case twoElementsLabel(x: T, fn: () -> T)
227+
case twoElementsNoLabel(_ x: T, _ fn: () -> T)
228+
}
229+
230+
func useTrailingClosureGeneric<T>(t: T) {
231+
_ = TrailingClosureGeneric<T>.label { t }
232+
_ = TrailingClosureGeneric<T>.noLabel { t }
233+
_ = TrailingClosureGeneric<T>.twoElementsLabel(x: t) { t }
234+
_ = TrailingClosureGeneric<T>.twoElementsNoLabel(t) { t }
235+
}

test/SILGen/enum_curry_thunks.swift

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
// RUN: %target-swift-emit-silgen -parse-as-library %s | %FileCheck %s
22

33
enum PartialApplyEnumPayload<T, U> {
4-
case Left(T)
5-
case Both(T, U)
4+
case left(T)
5+
case both(T, U)
66

7-
case LeftWithLabel(left: T)
8-
case BothWithLabel(left: T, right: U)
7+
case leftWithLabel(left: T)
8+
case bothWithLabel(left: T, right: U)
99

10-
case TupleWithLabel(both: (T, U))
10+
case tupleWithLabel(both: (T, U))
1111

1212
// Note: SILGen can emit these thunks correctly, but we disabled
1313
// the feature since calling the constructor directly (without a
1414
// thunk) doesn't work yet.
15-
/* case Variadic(_: Int...)
16-
case VariadicWithLabel(indices: Int...)
17-
case VariadicTuple(_: (Int, Int)...)
18-
case VariadicWithOther(String, _: Int...) */
15+
/* case variadic(_: Int...)
16+
case variadicWithLabel(indices: Int...)
17+
case variadicTuple(_: (Int, Int)...)
18+
case variadicWithOther(String, _: Int...) */
1919

20-
case Autoclosure(@autoclosure () -> ())
20+
case autoclosure(@autoclosure () -> ())
2121
}
2222

2323
struct S {}
2424
struct C {}
2525

2626
func partialApplyEnumCases(_ x: S, y: C) {
27-
_ = PartialApplyEnumPayload<S, C>.Left
28-
_ = PartialApplyEnumPayload<S, C>.Both
29-
_ = PartialApplyEnumPayload<S, C>.LeftWithLabel
30-
_ = PartialApplyEnumPayload<S, C>.TupleWithLabel
31-
/* _ = PartialApplyEnumPayload<S, C>.Variadic
32-
_ = PartialApplyEnumPayload<S, C>.VariadicWithLabel
33-
_ = PartialApplyEnumPayload<S, C>.VariadicTuple
34-
_ = PartialApplyEnumPayload<S, C>.VariadicWithOther */
35-
_ = PartialApplyEnumPayload<S, C>.Autoclosure
27+
_ = PartialApplyEnumPayload<S, C>.left
28+
_ = PartialApplyEnumPayload<S, C>.both
29+
_ = PartialApplyEnumPayload<S, C>.leftWithLabel
30+
_ = PartialApplyEnumPayload<S, C>.tupleWithLabel
31+
/* _ = PartialApplyEnumPayload<S, C>.variadic
32+
_ = PartialApplyEnumPayload<S, C>.variadicWithLabel
33+
_ = PartialApplyEnumPayload<S, C>.variadicTuple
34+
_ = PartialApplyEnumPayload<S, C>.variadicWithOther */
35+
_ = PartialApplyEnumPayload<S, C>.autoclosure
3636
}
3737

38-
// CHECK-LABEL: sil shared [transparent] [thunk] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4LeftyACyxq_GxcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T) -> @out PartialApplyEnumPayload<T, U> {
39-
// CHECK-LABEL: sil shared [transparent] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4LeftyACyxq_GxcAEmr0_lF : $@convention(method) <T, U> (@in T, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
38+
// CHECK-LABEL: sil shared [transparent] [thunk] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4leftyACyxq_GxcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T) -> @out PartialApplyEnumPayload<T, U> {
39+
// CHECK-LABEL: sil shared [transparent] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4leftyACyxq_GxcAEmr0_lF : $@convention(method) <T, U> (@in T, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
4040

41-
// CHECK-LABEL: sil shared [transparent] [thunk] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4BothyACyxq_Gx_q_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T, @in_guaranteed U) -> @out PartialApplyEnumPayload<T, U> {
42-
// CHECK-LABEL: sil shared [transparent] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4BothyACyxq_Gx_q_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @in U, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
41+
// CHECK-LABEL: sil shared [transparent] [thunk] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4bothyACyxq_Gx_q_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T, @in_guaranteed U) -> @out PartialApplyEnumPayload<T, U> {
42+
// CHECK-LABEL: sil shared [transparent] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4bothyACyxq_Gx_q_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @in U, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
4343

44-
// CHECK-LABEL: sil shared [transparent] [thunk] @$s17enum_curry_thunks23PartialApplyEnumPayloadO13LeftWithLabelyACyxq_Gx_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T) -> @out PartialApplyEnumPayload<T, U> {
45-
// CHECK-LABEL: sil shared [transparent] @$s17enum_curry_thunks23PartialApplyEnumPayloadO13LeftWithLabelyACyxq_Gx_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
44+
// CHECK-LABEL: sil shared [transparent] [thunk] @$s17enum_curry_thunks23PartialApplyEnumPayloadO13leftWithLabelyACyxq_Gx_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T) -> @out PartialApplyEnumPayload<T, U> {
45+
// CHECK-LABEL: sil shared [transparent] @$s17enum_curry_thunks23PartialApplyEnumPayloadO13leftWithLabelyACyxq_Gx_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
4646

47-
// CHECK-LABEL: sil shared [transparent] [thunk] @$s17enum_curry_thunks23PartialApplyEnumPayloadO14TupleWithLabelyACyxq_Gx_q_t_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T, @in_guaranteed U) -> @out PartialApplyEnumPayload<T, U> {
48-
// CHECK-LABEL: sil shared [transparent] @$s17enum_curry_thunks23PartialApplyEnumPayloadO14TupleWithLabelyACyxq_Gx_q_t_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @in U, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
47+
// CHECK-LABEL: sil shared [transparent] [thunk] @$s17enum_curry_thunks23PartialApplyEnumPayloadO14tupleWithLabelyACyxq_Gx_q_t_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T, @in_guaranteed U) -> @out PartialApplyEnumPayload<T, U> {
48+
// CHECK-LABEL: sil shared [transparent] @$s17enum_curry_thunks23PartialApplyEnumPayloadO14tupleWithLabelyACyxq_Gx_q_t_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @in U, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
4949

50-
// CHECK-LABEL: sil shared [transparent] [thunk] @$s17enum_curry_thunks23PartialApplyEnumPayloadO11AutoclosureyACyxq_GyyXAcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@guaranteed @callee_guaranteed () -> ()) -> @out PartialApplyEnumPayload<T, U> {
51-
// CHECK-LABEL: sil shared [transparent] @$s17enum_curry_thunks23PartialApplyEnumPayloadO11AutoclosureyACyxq_GyyXAcAEmr0_lF : $@convention(method) <T, U> (@owned @callee_guaranteed () -> (), @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
50+
// CHECK-LABEL: sil shared [transparent] [thunk] @$s17enum_curry_thunks23PartialApplyEnumPayloadO11autoclosureyACyxq_GyyXAcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@guaranteed @callee_guaranteed () -> ()) -> @out PartialApplyEnumPayload<T, U> {
51+
// CHECK-LABEL: sil shared [transparent] @$s17enum_curry_thunks23PartialApplyEnumPayloadO11autoclosureyACyxq_GyyXAcAEmr0_lF : $@convention(method) <T, U> (@owned @callee_guaranteed () -> (), @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {

test/SILGen/enum_generic_raw_value.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
// CHECK-LABEL: sil hidden @$s22enum_generic_raw_value1EO
44
enum E<T>: Int {
5-
case A = 1
5+
case a = 1
66
}
77

88
// CHECK-LABEL: sil hidden @$s22enum_generic_raw_value1FO
99
enum F<T: ExpressibleByIntegerLiteral>: T where T: Equatable {
10-
case A = 1
10+
case a = 1
1111
}

0 commit comments

Comments
 (0)