KT-12054 J2K generates obj is Type<Any> instead of obj is Type<*>
#KT-12054 Fixed
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
import java.util.HashSet
|
||||
|
||||
internal class Foo {
|
||||
fun foo(o: HashSet<Any?>?) {
|
||||
val o2: HashSet<Any?>? = o
|
||||
fun foo(o: HashSet<*>?) {
|
||||
val o2: HashSet<*>? = o
|
||||
var foo: Int = 0
|
||||
foo = o2!!.size
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.util.HashSet
|
||||
|
||||
internal class Foo {
|
||||
fun foo(o: HashSet<Any>) {
|
||||
fun foo(o: HashSet<*>) {
|
||||
val o2 = o
|
||||
var foo = 0
|
||||
foo = o2.size
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
class C {
|
||||
boolean bar(Object o, Collection<String> collection) {
|
||||
return o instanceof Collection && collection instanceof List;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
internal class C {
|
||||
fun bar(o: Any, collection: Collection<String>): Boolean {
|
||||
return o is Collection<*> && collection is List<*>
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
//TODO: uncomment this test when KT-12133 fixed
|
||||
class JavaClass1<T extends JavaClass2> {
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// ERROR: Type inference failed. Expected type mismatch: inferred type is HashMap<Any!, Any!> but Map<String, String> was expected
|
||||
// ERROR: Type inference failed. Expected type mismatch: inferred type is HashMap<Any?, Any?> but Map<String, String> was expected
|
||||
import java.util.*
|
||||
|
||||
internal object A {
|
||||
fun foo(): Map<String, String> {
|
||||
val props = Properties()
|
||||
return HashMap(props as Map<Any, Any>)
|
||||
return HashMap(props as Map<*, *>)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user