problematic test with CL / ELA / return type
diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/ela.fir.txt b/compiler/testData/diagnostics/tests/collectionLiterals/ela.fir.txt new file mode 100644 index 0000000..27c4816 --- /dev/null +++ b/compiler/testData/diagnostics/tests/collectionLiterals/ela.fir.txt
@@ -0,0 +1,22 @@ +FILE: main.kt + package test2 + + public final fun <D : R|kotlin/collections/Collection<E>|, E> foo(d: R|D|, lam: R|(E) -> kotlin/Int|): R|D| { + ^foo R|<local>/d| + } + @R|kotlin/jvm/JvmName|(name = String(foo2) [evaluated = String(foo2)]) public final fun <D : R|kotlin/collections/Collection<E>|, E> foo(d: R|D|, lam: R|(E) -> kotlin/String|): R|D| { + ^foo R|<local>/d| + } + public final fun <D : R|kotlin/collections/Collection<E>|, E> bar(d: R|D|, lam: R|(E) -> kotlin/Int|): R|D| { + ^bar R|<local>/d| + } + public final fun test(): R|kotlin/Unit| { + lval x: R|kotlin/collections/Set<kotlin/Int>| = R|test2/foo|<R|kotlin/collections/List<kotlin/Int>|, R|kotlin/Int|>(Q|kotlin/collections|.R|kotlin/collections/listOf|<R|kotlin/Int|>(vararg(Int(1), Int(2), Int(3))), <L> = foo@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| <inline=NoInline> { + ^ R|<local>/it| + } + ) + lval y: R|kotlin/collections/Set<kotlin/Int>| = R|test2/bar|<R|kotlin/collections/Set<kotlin/Int>|, R|kotlin/Int|>(Q|kotlin/collections|.R|kotlin/collections/setOf|<R|kotlin/Int|>(vararg(Int(1), Int(2), Int(3))), <L> = bar@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| <inline=NoInline> { + ^ R|<local>/it| + } + ) + }
diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/ela.kt b/compiler/testData/diagnostics/tests/collectionLiterals/ela.kt new file mode 100644 index 0000000..d489374 --- /dev/null +++ b/compiler/testData/diagnostics/tests/collectionLiterals/ela.kt
@@ -0,0 +1,19 @@ +// LANGUAGE: +CollectionLiterals +EagerLambdaAnalysis +ContextSensitiveResolutionUsingExpectedType +// RUN_PIPELINE_TILL: FRONTEND +// WITH_STDLIB + +// FILE: test2/main.kt +package test2 + +fun <D: Collection<E>, E> foo(d: D, lam: (E) -> Int): D= d +@JvmName("foo2") +fun <D: Collection<E>, E> foo(d: D, lam: (E) -> String): D = d +fun <D: Collection<E>, E> bar(d: D, lam: (E) -> Int): D = d + +fun test() { + val x: Set<Int> <!INITIALIZER_TYPE_MISMATCH!>=<!> foo([1, 2, 3]) { it } + val y: Set<Int> = bar([1, 2, 3]) { it } +} + + +/* GENERATED_FIR_TAGS: functionDeclaration, functionalType, integerLiteral, lambdaLiteral, stringLiteral */