deprecating types after colon
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: A.java
|
||||
public class A {}
|
||||
|
||||
@@ -17,7 +18,7 @@ public class Y extends X<String> {
|
||||
// FILE: test.kt
|
||||
|
||||
fun main() {
|
||||
Y().fooN() : Any
|
||||
checkSubtype<Any>(Y().fooN())
|
||||
Y().barN(null);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: A.java
|
||||
public class A {}
|
||||
|
||||
@@ -17,7 +18,7 @@ public class Y extends X<A> {
|
||||
// FILE: test.kt
|
||||
|
||||
fun main() {
|
||||
Y().fooN() : Any
|
||||
checkSubtype<Any>(Y().fooN())
|
||||
Y().barN(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
//KT-2394 java.lang.Iterable<T> should be visible as kotlin.Iterable<out T>
|
||||
package d
|
||||
|
||||
fun foo(iterable: Iterable<Int>, iterator: Iterator<Int>, comparable: Comparable<Any>) {
|
||||
iterable : Iterable<Any>
|
||||
iterator : Iterator<Any>
|
||||
comparable : Comparable<String>
|
||||
checkSubtype<Iterable<Any>>(iterable)
|
||||
checkSubtype<Iterator<Any>>(iterator)
|
||||
checkSubtype<Comparable<String>>(comparable)
|
||||
}
|
||||
|
||||
fun bar(c: Collection<Int>) {
|
||||
c : Iterable<Any>
|
||||
c.iterator() : Iterator<Any>
|
||||
checkSubtype<Iterable<Any>>(c)
|
||||
checkSubtype<Iterator<Any>>(c.iterator())
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
package a
|
||||
|
||||
import <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.Iterator<!>
|
||||
@@ -9,7 +11,7 @@ fun bar(any: Any): <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Iterable<Int><!>
|
||||
val <!UNUSED_VARIABLE!>c<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Iterator<String><!>? = null
|
||||
|
||||
if (any is <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Iterator<*><!>) {
|
||||
<!DEBUG_INFO_SMARTCAST!>any<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Iterator<*><!>
|
||||
checkSubtype<<!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Iterator<*><!>>(<!DEBUG_INFO_SMARTCAST!>any<!>)
|
||||
}
|
||||
any as <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Iterator<*><!>
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user