diff --git a/compiler/testData/codegen/boxWithStdlib/annotations/resolveWithLowPriorityAnnotation.kt b/compiler/testData/codegen/boxWithStdlib/annotations/resolveWithLowPriorityAnnotation.kt index 48fe83401f9..c6d843454ec 100644 --- a/compiler/testData/codegen/boxWithStdlib/annotations/resolveWithLowPriorityAnnotation.kt +++ b/compiler/testData/codegen/boxWithStdlib/annotations/resolveWithLowPriorityAnnotation.kt @@ -4,4 +4,27 @@ fun foo(i: Int) = 1 fun foo(a: Any) = 2 -fun box() = if (foo(1) == 2) "OK" else "fail" \ No newline at end of file +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +fun Iterable.contains1(element: @kotlin.internal.NoInfer T): Boolean = false + +@kotlin.jvm.JvmName("containsAny") +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@kotlin.internal.LowPriorityInOverloadResolution +fun Iterable.contains1(element: T): Boolean = true + +fun main(args: Array) { + println(box()) +} +fun box(): String { + if (foo(1) != 2) return "fail" + val l = listOf(1, 2) + val i: Int? = 42 + val a: Any = "" + return when { + l.contains1(3) -> "fail0" + !l.contains1(i) -> "fail1" + !l.contains1(a) -> "fail2" + !l.contains1("") -> "fail3" + else -> "OK" + } +} \ No newline at end of file