Original type is taken into account when intersecting possible types in resolve #KT-10232 Fixed
This commit is contained in:
committed by
Stanislav Erokhin
parent
db2521ee67
commit
fe04cc513b
@@ -0,0 +1,15 @@
|
||||
// Type inference failed after smart cast
|
||||
|
||||
interface A<T>
|
||||
interface B<T> : A<T>
|
||||
|
||||
fun <T> foo(b: A<T>) = b
|
||||
|
||||
fun <T> test(a: A<T>) {
|
||||
if (a is Any) {
|
||||
// Error:(9, 9) Kotlin: Type inference failed: fun <T> foo(b: A<T>): kotlin.Unit
|
||||
// cannot be applied to (A<T>)
|
||||
foo(a)
|
||||
}
|
||||
foo(a) // ok
|
||||
}
|
||||
Reference in New Issue
Block a user