@@ -38,10 +38,9 @@ class KSearchedCaseDSL : KElseDSL {
3838 .withSubCriteria(subCriteria)
3939 .withThenValue(thenValue)
4040 .build())
41-
4241 }
4342
44- override fun `else` (column : BasicColumn ) {
43+ override infix fun `else` (column : BasicColumn ) {
4544 this .elseValue = column
4645 }
4746}
@@ -53,7 +52,7 @@ class SearchedCaseCriteriaCollector : GroupingCriteriaCollector(), KThenDSL {
5352 field = value
5453 }
5554
56- override fun then (column : BasicColumn ) {
55+ override infix fun then (column : BasicColumn ) {
5756 thenValue = column
5857 }
5958}
@@ -67,26 +66,26 @@ class KSimpleCaseDSL<T : Any> : KElseDSL {
6766 internal val whenConditions = mutableListOf<SimpleCaseWhenCondition <T >>()
6867
6968 fun `when` (firstCondition : VisitableCondition <T >, vararg subsequentConditions : VisitableCondition <T >) =
70- SimpleCaseThenGatherer {
69+ SimpleCaseThenGatherer { thenValue ->
7170 val allConditions = buildList {
7271 add(firstCondition)
7372 addAll(subsequentConditions)
7473 }
7574
76- whenConditions.add(ConditionBasedWhenCondition (allConditions, it ))
75+ whenConditions.add(ConditionBasedWhenCondition (allConditions, thenValue ))
7776 }
7877
7978 fun `when` (firstValue : T , vararg subsequentValues : T ) =
80- SimpleCaseThenGatherer {
79+ SimpleCaseThenGatherer { thenValue ->
8180 val allConditions = buildList {
8281 add(firstValue)
8382 addAll(subsequentValues)
8483 }
8584
86- whenConditions.add(BasicWhenCondition (allConditions, it ))
85+ whenConditions.add(BasicWhenCondition (allConditions, thenValue ))
8786 }
8887
89- override fun `else` (column : BasicColumn ) {
88+ override infix fun `else` (column : BasicColumn ) {
9089 this .elseValue = column
9190 }
9291}
@@ -122,25 +121,25 @@ interface KThenDSL {
122121}
123122
124123interface KElseDSL {
125- fun `else` (value : String ) {
124+ infix fun `else` (value : String ) {
126125 `else `(stringConstant(value))
127126 }
128127
129- fun `else` (value : Boolean ) {
128+ infix fun `else` (value : Boolean ) {
130129 `else `(constant<String >(value.toString()))
131130 }
132131
133- fun `else` (value : Int ) {
132+ infix fun `else` (value : Int ) {
134133 `else `(constant<String >(value.toString()))
135134 }
136135
137- fun `else` (value : Long ) {
136+ infix fun `else` (value : Long ) {
138137 `else `(constant<String >(value.toString()))
139138 }
140139
141- fun `else` (value : Double ) {
140+ infix fun `else` (value : Double ) {
142141 `else `(constant<String >(value.toString()))
143142 }
144143
145- fun `else` (column : BasicColumn )
144+ infix fun `else` (column : BasicColumn )
146145}
0 commit comments