Extraction Engine: Suggest both bounds for nullability-flexible types without nullability annotations. Do not omit return type if inferred one is flexible

#KT-6837 Fixed
This commit is contained in:
Alexey Sedunov
2015-05-25 14:42:55 +03:00
parent 72205540d6
commit 58ef7f2691
24 changed files with 221 additions and 37 deletions
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// SUGGESTED_RETURN_TYPES: kotlin.Boolean?, kotlin.Boolean
// PARAM_DESCRIPTOR: value-parameter val it: kotlin.Map.Entry<(Boolean..Boolean?), (Boolean..Boolean?)> defined in test.<anonymous>
// PARAM_TYPES: kotlin.Map.Entry<(Boolean..Boolean?), (Boolean..Boolean?)>
fun test() {
@@ -1,8 +1,9 @@
// WITH_RUNTIME
// SUGGESTED_RETURN_TYPES: kotlin.Boolean?, kotlin.Boolean
// PARAM_DESCRIPTOR: value-parameter val it: kotlin.Map.Entry<(Boolean..Boolean?), (Boolean..Boolean?)> defined in test.<anonymous>
// PARAM_TYPES: kotlin.Map.Entry<(Boolean..Boolean?), (Boolean..Boolean?)>
fun test() {
J.getMap().filter { b(it) }
}
private fun b(it: Map.Entry<Boolean, Boolean>) = it.getKey()
private fun b(it: Map.Entry<Boolean, Boolean>): Boolean? = it.getKey()