Dependabot is trying to upgrade micrometer from 1....
# getting-started
r
Dependabot is trying to upgrade micrometer from 1.15.5 to 1.16.0 and my Kotlin is no longer compiling:
Copy code
fun nullableReturn(): String? = TODO()

val timer: Timer = TODO()

try {
  timer.recordCallable {
    nullableReturn()
  }
} finally {
  timer.close()
}
> Argument type mismatch: actual type is 'CallableString?', but 'Callable<uninferred T! (of fun T : Any recordCallable)>!' was expected.
It's happy if
nullableReturn
returns
String
rather than
String?
. I presume it's something to do with the signature of `Timer.recordCallable`:
T @NullUnmarked T recordCallable(CallableT f) throws Exception;
But I think micrometer is trying to say that
T
could be nullable there? Have they made a mistake?
Raised https://github.com/micrometer-metrics/micrometer/issues/6869 on the assumption it's more likely to be a micrometer bug than a kotlinc bug, but if you know otherwise tell me and I'll close it and raise a kotlinc issue.
The package containing Timer has a
package-info.java
as so:
Copy code
@NullMarked
package io.micrometer.core.instrument;

import org.jspecify.annotations.NullMarked;