My thought is that takeIf statements should be able to influence type inference.
Hopefully the scenario below demonstrates what I mean:
fun someFunction(any: Any?, bool: Boolean){
any
?.takeIf{ it is Boolean }
?.let { it && bool } // error: "Type Mismatch\n Required: Boolean\n Found: Any"
}
Any thoughts?
EDIT: Changed ‘any’ to ‘it’