Kotlin "None of the following functions can be called" in CI
Overload resolution failed: none of the candidate overloads accepts the argument types you passed. The compiler lists the candidates it considered.
What this error means
The build fails with None of the following functions can be called with the arguments supplied, followed by the candidate signatures. It is deterministic.
gradle
e: file:///src/main/kotlin/App.kt:14:9 None of the following functions
can be called with the arguments supplied:
public fun println(message: Any?): Unit
public fun println(message: Int): UnitCommon causes
Argument types do not match any overload
A nullable, wrongly typed, or extra argument means no candidate signature fits.
Ambiguous numeric or nullable types
A nullable value or an unexpected numeric type (Long vs Int) excludes the overloads you intended.
How to fix it
Match an overload exactly
Convert or unwrap the argument so it fits one candidate signature.
App.kt
val n: Int = count ?: 0
println(n)Read the candidate list
- Compare your argument types against each listed candidate.
- Convert the argument to the type a candidate accepts.
- Add an explicit cast or named argument to disambiguate.
How to prevent it
- Pass arguments whose types match an overload.
- Resolve nullability before the call.
- Use named arguments for clarity on overloaded APIs.
Related guides
Kotlin "Type mismatch" in CIFix the Kotlin "Type mismatch: inferred type is X but Y was expected" compile error in Gradle CI builds - inc…
Kotlin "incompatible types" in when expression in CIFix the Kotlin "incompatible types" / non-exhaustive when error in Gradle CI when a when expression branches…
Kotlin "Smart cast is impossible" in CIFix the Kotlin "Smart cast to X is impossible, because the value is a mutable / open property" compile error…