K2: Use Any? expected type only for the right argument of == operator
^KT-47409 Fixed
This commit is contained in:
committed by
Space Team
parent
447e1711da
commit
6b2da2069d
@@ -10,7 +10,7 @@ FILE: equals.kt
|
||||
}
|
||||
|
||||
when () {
|
||||
==(R|/materialize|<R|kotlin/Any?|>(), String()) -> {
|
||||
==(R|/materialize<CS errors: /materialize>#|<<ERROR TYPE REF: Cannot infer argument for type parameter T>>(), String()) -> {
|
||||
^main Unit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// ISSUE: KT-47409
|
||||
fun <T> materialize(): T = TODO()
|
||||
|
||||
fun main() {
|
||||
if ("" == materialize()) return // FE1.0: OK, type argument inferred to Any?
|
||||
if (materialize() == "") return // FE1.0: Error, uninferred type argument for `T`
|
||||
if (<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>materialize<!>() == "") return // FE1.0: Error, uninferred type argument for `T`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user