Skip to content

Commit 694a7fd

Browse files
authored
Merge pull request #230 from modelix/bugfix/forth-fourth
fix(modelql): rename zip accessor forth -> fourth
2 parents 1d14313 + cabce1f commit 694a7fd

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/ZipElementAccessStep.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ val <T> IMonoStep<IZip2Output<*, *, T>>.second: IMonoStep<T>
5252
get() = ZipElementAccessStep<T>(1).also { connect(it) }
5353
val <T> IMonoStep<IZip3Output<*, *, *, T>>.third: IMonoStep<T>
5454
get() = ZipElementAccessStep<T>(2).also { connect(it) }
55+
56+
@Deprecated("Use fourth, the version without type", ReplaceWith("fourth"))
5557
val <T> IMonoStep<IZip4Output<*, *, *, *, T>>.forth: IMonoStep<T>
5658
get() = ZipElementAccessStep<T>(3).also { connect(it) }
59+
val <T> IMonoStep<IZip4Output<*, *, *, *, T>>.fourth: IMonoStep<T>
60+
get() = ZipElementAccessStep<T>(3).also { connect(it) }
5761
val <T> IMonoStep<IZip5Output<*, *, *, *, *, T>>.fifth: IMonoStep<T>
5862
get() = ZipElementAccessStep<T>(4).also { connect(it) }
5963
val <T> IMonoStep<IZip6Output<*, *, *, *, *, *, T>>.sixth: IMonoStep<T>
@@ -68,7 +72,7 @@ val <T> IMonoStep<IZip9Output<*, *, *, *, *, *, *, *, *, T>>.ninth: IMonoStep<T>
6872
operator fun <T> IMonoStep<IZip1Output<*, T>>.component1() = first
6973
operator fun <T> IMonoStep<IZip2Output<*, *, T>>.component2() = second
7074
operator fun <T> IMonoStep<IZip3Output<*, *, *, T>>.component3() = third
71-
operator fun <T> IMonoStep<IZip4Output<*, *, *, *, T>>.component4() = forth
75+
operator fun <T> IMonoStep<IZip4Output<*, *, *, *, T>>.component4() = fourth
7276
operator fun <T> IMonoStep<IZip5Output<*, *, *, *, *, T>>.component5() = fifth
7377
operator fun <T> IMonoStep<IZip6Output<*, *, *, *, *, *, T>>.component6() = sixth
7478
operator fun <T> IMonoStep<IZip7Output<*, *, *, *, *, *, *, T>>.component7() = seventh

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/ZipStep.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,13 @@ interface IZipOutput<out Common> { val values: List<Common> }
296296
interface IZip1Output<out Common, out E1> : IZipOutput<Common> { val first: E1 }
297297
interface IZip2Output<out Common, out E1, out E2> : IZip1Output<Common, E1> { val second: E2 }
298298
interface IZip3Output<out Common, out E1, out E2, out E3> : IZip2Output<Common, E1, E2> { val third: E3 }
299-
interface IZip4Output<out Common, out E1, out E2, out E3, out E4> : IZip3Output<Common, E1, E2, E3> { val forth: E4 }
299+
interface IZip4Output<out Common, out E1, out E2, out E3, out E4> : IZip3Output<Common, E1, E2, E3> {
300+
val fourth: E4
301+
302+
@Deprecated("Use fourth, the version without typo", ReplaceWith("fourth"))
303+
val forth
304+
get() = fourth
305+
}
300306
interface IZip5Output<out Common, out E1, out E2, out E3, out E4, out E5> : IZip4Output<Common, E1, E2, E3, E4> { val fifth: E5 }
301307
interface IZip6Output<out Common, out E1, out E2, out E3, out E4, out E5, out E6> : IZip5Output<Common, E1, E2, E3, E4, E5> { val sixth: E6 }
302308
interface IZip7Output<out Common, out E1, out E2, out E3, out E4, out E5, out E6, out E7> : IZip6Output<Common, E1, E2, E3, E4, E5, E6> { val seventh: E7 }
@@ -306,7 +312,7 @@ interface IZip9Output<out Common, out E1, out E2, out E3, out E4, out E5, out E6
306312
operator fun <T> IZip1Output<*, T>.component1() = first
307313
operator fun <T> IZip2Output<*, *, T>.component2() = second
308314
operator fun <T> IZip3Output<*, *, *, T>.component3() = third
309-
operator fun <T> IZip4Output<*, *, *, *, T>.component4() = forth
315+
operator fun <T> IZip4Output<*, *, *, *, T>.component4() = fourth
310316
operator fun <T> IZip5Output<*, *, *, *, *, T>.component5() = fifth
311317
operator fun <T> IZip6Output<*, *, *, *, *, *, T>.component6() = sixth
312318
operator fun <T> IZip7Output<*, *, *, *, *, *, *, T>.component7() = seventh
@@ -320,7 +326,7 @@ data class ZipOutput<out Common, out E1, out E2, out E3, out E4, out E5, out E6,
320326
override val first: E1 get() = values[0] as E1
321327
override val second: E2 get() = values[1] as E2
322328
override val third: E3 get() = values[2] as E3
323-
override val forth: E4 get() = values[3] as E4
329+
override val fourth: E4 get() = values[3] as E4
324330
override val fifth: E5 get() = values[4] as E5
325331
override val sixth: E6 get() = values[5] as E6
326332
override val seventh: E7 get() = values[6] as E7

0 commit comments

Comments
 (0)