Open inktomi opened 3 years ago
Reproducer: https://github.com/bohsen/TestProject
Problem persists whenever you mock a lambda (or a Function
). Hopefully the new IR backend isn't about to be enabled by default just yet. Fails with both kotlin 1.4.21, 1.4.30-M1 and 1.4.30-RC.
Youtrack issue: https://youtrack.jetbrains.com/issue/KT-44429
Fixed in kotlin 1.5.
If you have a project using Kotlin 1.4.21 (and mockito-kotlin 2.2.0) and you turn on the new IR backend, the mocking behavior changes.
Without IR, this mock seems to work
private val validator: (String?, String?) -> Boolean = mock()
- but with IR enabled,validator
isnull
.With
useIR = false
the following test passes:But switch it to
useIR = true
and you get