[FIR-TEST] Add new testdata generated after changes in previous commit

This commit is contained in:
Dmitriy Novozhilov
2019-12-11 16:16:22 +03:00
parent e9c02a1cca
commit 2536fa0cd5
4578 changed files with 104067 additions and 1 deletions
@@ -0,0 +1,7 @@
fun add(a: Int, b: Int) = a + b
interface A {
fun <T> shuffle(x: List<T>): List<T>
fun <T> foo(f : (List<T>) -> List<T>, x : List<T>)
fun f() : (Int, Int) -> Int = ::add
}
@@ -0,0 +1,9 @@
class A {
val x = arrayListOf<(A<<!SYNTAX!><!>>) -> Unit>()
// Here we got an exception during type comparison
fun foo(){
x.add {}
}
}
@@ -0,0 +1,7 @@
data class A(val x: Int) {
fun toArray(): IntArray =
intArrayOf(x)
override fun toString() =
toArray().takeWhile { it != -1 } // .joinToString()
}
@@ -0,0 +1,17 @@
class O : Function2<Int, String, Unit> {
override fun invoke(p1: Int, p2: String) {
}
}
fun test() {
val a = fun(o: O) {
}
<!INAPPLICABLE_CANDIDATE!>a<!> {}
}
class Ext : String.() -> Unit {
}
fun test2() {
val f: Ext = {}
}
@@ -0,0 +1,8 @@
@JvmName()
fun foo() {}
@JvmName(42)
fun bar() {}
@JvmName("a", "b")
fun baz() {}
@@ -0,0 +1,9 @@
fun foo1(p: Pair<Int?, Int>): Int {
if (p.first != null) return p.first!!
return p.second
}
fun foo2(p: Pair<Int?, Int>): Int {
if (p.first != null) return p.first
return p.second
}
@@ -0,0 +1,10 @@
fun foo(c : Collection<String>) = {
c.filter{
val s : String? = bar()
if (s == null) false // here!
zoo(s)
}
}
fun bar() : String? = null
fun zoo(s : String) : Boolean = true
@@ -0,0 +1,9 @@
const val myPi = kotlin.math.PI
annotation class Anno(val d: Double)
@Anno(kotlin.math.PI)
fun f() {}
@Anno(myPi)
fun g() {}
@@ -0,0 +1,19 @@
// !LANGUAGE: +NewInference
fun main() {
val list = listOf(A())
list.forEach(A::foo)
list.forEach {
it.foo()
}
}
class A {
@ExperimentalTime
fun foo() {
println("a")
}
}
@Experimental(level = Experimental.Level.ERROR)
annotation class ExperimentalTime
@@ -0,0 +1,3 @@
//KT-9345 Type inference failure
fun Class<*>.foo(): Any? = kotlin.<!UNRESOLVED_REFERENCE!>objectInstance<!>
@@ -0,0 +1,16 @@
// FILE: J.java
import kotlin.jvm.functions.Function1;
public interface J extends Function1<Integer, Void> {
}
// FILE: 1.kt
fun useJ(j: J) {
j(42)
}
fun jj() {
useJ({})
}