kalidation
kalidation copied to clipboard
returnOf on a nested property always fails
class MyTest {
class A {
fun t(): Int {
return 0
}
}
data class B(val nested: A = A())
@Test
fun test() {
val spec = validationSpec {
constraints<B> {
property(B::nested) {
valid()
}
}
constraints<A> {
returnOf(A::t) {
positive()
}
}
}
spec.validate(B())
}
}
Throws: A.t() kotlin.Int must belong to class B(nested=A())) to be callable