MarkRS
08/14/2024, 9:53 AMval circleExh = cartesian(
Exhaustive.collection(listOf(start)),
Exhaustive.collection(listOf(0..360)),
Exhaustive.collection(listOf(400)),
Exhaustive.collection(listOf("left", "right")),
Exhaustive.collection(listOf(90, 180, 270, 360)),
Exhaustive.collection(listOf(Pair(400, 300), Pair(200, 300), Pair(300, 400), Pair(300, 200),
Pair(400, 200), Pair(400, 400), Pair(200, 400), Pair(200, 200))),
Exhaustive.collection(listOf(5))
) { start: Points, startAngle: Int, radius: Int, direction: String, turn: Int, centre: Pair<Int, Int>, duration: Int ->
Circle(listOf(start, startAngle, radius, turn, centre, direction, duration)) }
fails lint "because of receiver type mismatch". Why?
I couldn't find any documentation about "cartesian" but found it in StackExchange, but it seems to be a thing.
My exhaustive collections of only one item seemed to be necessary, but the error statement was the same when I just put the single item in the Circle function call definition.
How do I fix this?CLOVIS
08/14/2024, 10:00 AMEmil Kantis
08/14/2024, 10:11 AMExhaustive.collection(listOf(0..360))
will return an Exhaustive<IntRange>, not Exhaustive<Int> as your code requires. You can write it as Exhaustive.ints(0..360)
insteadEmil Kantis
08/14/2024, 10:11 AMExhaustive.collection(listOf(90, 180, 270, 360))
can be simplified as Exhaustive.of(90, 180, 270, 360)
MarkRS
08/14/2024, 10:45 AMUnresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public fun <A, B, C> Exhaustive.Companion.cartesian(a: Exhaustive<TypeVariable(A)>, b: Exhaustive<TypeVariable(B)>, f: (TypeVariable(A), TypeVariable(B)) → TypeVariable(C)): Exhaustive<TypeVariable(C)> defined in io.kotest.property.exhaustive
With every possibility up to 13 types.Emil Kantis
08/14/2024, 10:56 AMMarkRS
08/14/2024, 10:57 AMclass Circle(shapeParams: List<Any>): Shaping() { }
Emil Kantis
08/14/2024, 10:59 AMstart
is a Points
?MarkRS
08/14/2024, 10:59 AMMarkRS
08/14/2024, 11:02 AMval start = Points()
start.widthPos = 300F
start.lengthPos = 300F
Those are the only two properties needed in PointsMarkRS
08/14/2024, 11:03 AMEmil Kantis
08/14/2024, 11:04 AMEmil Kantis
08/14/2024, 11:05 AMEmil Kantis
08/14/2024, 11:05 AMMarkRS
08/14/2024, 11:06 AMMarkRS
08/14/2024, 11:07 AMLeoColman
08/14/2024, 3:31 PMLeoColman
08/14/2024, 3:31 PM