From b2b3d6273e1c3c045910d314e108112ea5bfad68 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Mon, 10 Sep 2012 18:02:40 +0400 Subject: [PATCH] improved test --- compiler/testData/diagnostics/tests/j+k/kt2641.kt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/compiler/testData/diagnostics/tests/j+k/kt2641.kt b/compiler/testData/diagnostics/tests/j+k/kt2641.kt index c25e107c899..02679e02348 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt2641.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt2641.kt @@ -1,11 +1,16 @@ -//KT-2641 Warn on using j.l.Iterable in Kotlin code -package n +package a import java.util.Iterator import java.lang.Comparable as Comp -fun bar() : java.lang.Iterable? { - val a : java.lang.Comparable? = null - val b : Iterable<Integer> +fun bar(any: Any): java.lang.Iterable? { + val a: java.lang.Comparable? = null + val b: Iterable<Integer> + val c : Iterator? = null + + if (any is Iterator<*>) { + any : Iterator<*> + } + any as Iterator<*> return null } \ No newline at end of file