deprecating types after colon
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
package a
|
||||
|
||||
fun <T> id(t: T): T = t
|
||||
@@ -15,17 +17,17 @@ fun test(a: A, b: B, c: C) {
|
||||
val d: C = id(<!DEBUG_INFO_SMARTCAST!>a<!>)
|
||||
val e: Any = id(a)
|
||||
val f = id(a)
|
||||
f: A
|
||||
checkSubtype<A>(f)
|
||||
val g = two(<!DEBUG_INFO_SMARTCAST!>a<!>, b)
|
||||
g: B
|
||||
g: A
|
||||
checkSubtype<B>(g)
|
||||
checkSubtype<A>(g)
|
||||
|
||||
// smart cast isn't needed, but is reported due to KT-4294
|
||||
val h: Any = two(<!DEBUG_INFO_SMARTCAST!>a<!>, b)
|
||||
|
||||
val k = three(a, b, c)
|
||||
k: A
|
||||
<!TYPE_MISMATCH!>k<!>: B
|
||||
checkSubtype<A>(k)
|
||||
checkSubtype<B>(<!TYPE_MISMATCH!>k<!>)
|
||||
val l: Int = <!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>three<!>(a, b, c)
|
||||
|
||||
use(d, e, f, g, h, k, l)
|
||||
@@ -47,8 +49,8 @@ fun testErrorMessages(a: A, ml: MutableList<String>) {
|
||||
fun rr(s: String?) {
|
||||
if (s != null) {
|
||||
val l = arrayListOf("", <!DEBUG_INFO_SMARTCAST!>s<!>)
|
||||
l: MutableList<String>
|
||||
<!TYPE_MISMATCH!>l<!>: MutableList<String?>
|
||||
checkSubtype<MutableList<String>>(l)
|
||||
checkSubtype<MutableList<String?>>(<!TYPE_MISMATCH!>l<!>)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user