From 27e6dad3074261f52b754e5b314b5dbab254739c Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Thu, 7 Feb 2013 18:09:39 +0400 Subject: [PATCH] test improved --- .../useBoundsToInferTypeParamsSimple.kt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt index 2a92270cfc7..f678821172a 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt @@ -1,15 +1,22 @@ package a -fun foo(v: V, u: U) = u -fun bar(v: V, u: U) = u +fun foo(v: V, u: U) = u +fun bar(v: V, u: U) = u fun test(a: Any, s: String) { - val b: Any = foo(a, s) - val c: Any = bar(a, s) + val b = foo(a, s) + checkItIsExactlyAny(a, arrayListOf(b)) + val c = bar(a, s) + checkItIsExactlyAny(a, arrayListOf(c)) } +fun checkItIsExactlyAny(t: T, l: MutableList) {} + fun baz(v: V, u: MutableSet) = u fun test(a: Any, s: MutableSet) { baz(a, s) } + +//from standard library +fun arrayListOf(vararg t: T): MutableList {} \ No newline at end of file