PoisonedYouth
10/15/2023, 11:29 AMclass Test {
fun sampleFunctionWithGenericReturnType(): List<Int> {
return emptyList()
}
fun sampleFunctionWithoutGenericReturnType(): Int{
return 0
}
}
I want to verify that a specified set of functions have a specified return type. This is working for simple types but as soon as I use generics the check is no longer working.
// This works
projectScope
.classes()
.functions()
.assert {
it.hasReturnTypeOf<Int>()
}
// This does not work
projectScope
.classes()
.functions()
.assert {
it.hasReturnTypeOf<List<Int>>()
Is this expected behavior or are generics not yet supported?igor.wojda
10/15/2023, 12:22 PMreified
will help. We will investigate. Thx for reporting.
https://lemonappdev.atlassian.net/browse/KON-559PoisonedYouth
10/15/2023, 5:15 PMigor.wojda
10/16/2023, 9:45 AMprojectScope
.classes()
.functions()
.assert {
it.hasReturnType { returnType ->
returnType.name == "List<Int>"
}
}
We will get back to this in the futurePoisonedYouth
10/16/2023, 10:27 AMigor.wojda
10/16/2023, 11:19 AMKoScopeForKoInterfaceDeclarationTest