Ambiguous overload resolution, when invoke extension function with overload and generic
class A {
fun test2(p2: T) {}
fun test2(p2: () -> T) {}
}
fun A.test3(p2: T) {}
fun A.test3(p2: () -> T) {}
fun test1(p2: T) {}
fun test1(p2: () -> T) {}
fun main() {
val a = A()
a.test2 { 2 }
test1 { 2 }
a.test3 { 2 } //Overload resolution ambiguity. All these functions match.
}
Why does IntelliJ IDEA suggest "Overload resolution ambiguity. " at the call site of test3? Examining the decompiled Java code, test3 doesn’t appear to have any notable...