// RUN: %target-swift-emit-silgen -parse-as-library %s | %FileCheck %s enum PartialApplyEnumPayload { case left(T) case both(T, U) case leftWithLabel(left: T) case bothWithLabel(left: T, right: U) case tupleWithLabel(both: (T, U)) // Note: SILGen can emit these thunks correctly, but we disabled // the feature since calling the constructor directly (without a // thunk) doesn't work yet. /* case variadic(_: Int...) case variadicWithLabel(indices: Int...) case variadicTuple(_: (Int, Int)...) case variadicWithOther(String, _: Int...) */ case autoclosure(@autoclosure () -> ()) } struct S {} struct C {} func partialApplyEnumCases(_ x: S, y: C) { _ = PartialApplyEnumPayload.left _ = PartialApplyEnumPayload.both _ = PartialApplyEnumPayload.leftWithLabel _ = PartialApplyEnumPayload.tupleWithLabel /* _ = PartialApplyEnumPayload.variadic _ = PartialApplyEnumPayload.variadicWithLabel _ = PartialApplyEnumPayload.variadicTuple _ = PartialApplyEnumPayload.variadicWithOther */ _ = PartialApplyEnumPayload.autoclosure } // CHECK-LABEL: sil private [ossa] @$s17enum_curry_thunks21partialApplyEnumCases_1yyAA1SV_AA1CVtFAA07PartialeF7PayloadOyAeGGAEcAJmcfu_AjEcfu0_ : $@convention(thin) (S, @thin PartialApplyEnumPayload.Type) -> @owned PartialApplyEnumPayload { // CHECK-LABEL: sil private [ossa] @$s17enum_curry_thunks21partialApplyEnumCases_1yyAA1SV_AA1CVtFAA07PartialeF7PayloadOyAeGGAE_AGtcAJmcfu1_AjE_AGtcfu2_ : $@convention(thin) (S, C, @thin PartialApplyEnumPayload.Type) -> @owned PartialApplyEnumPayload { // CHECK-LABEL: sil private [ossa] @$s17enum_curry_thunks21partialApplyEnumCases_1yyAA1SV_AA1CVtFAA07PartialeF7PayloadOyAeGGAEcAJmcfu3_AjEcfu4_ : $@convention(thin) (S, @thin PartialApplyEnumPayload.Type) -> @owned PartialApplyEnumPayload { // CHECK-LABEL: sil private [ossa] @$s17enum_curry_thunks21partialApplyEnumCases_1yyAA1SV_AA1CVtFAA07PartialeF7PayloadOyAeGGAE_AGt_tcAJmcfu5_AjE_AGt_tcfu6_ : $@convention(thin) (S, C, @thin PartialApplyEnumPayload.Type) -> @owned PartialApplyEnumPayload { // CHECK-LABEL: sil private [ossa] @$s17enum_curry_thunks21partialApplyEnumCases_1yyAA1SV_AA1CVtFAA07PartialeF7PayloadOyAeGGyyXAcAJmcfu7_AJyyXAcfu8_ : $@convention(thin) (@guaranteed @callee_guaranteed () -> (), @thin PartialApplyEnumPayload.Type) -> @owned PartialApplyEnumPayload {