[FIR-TEST] Add new testdata generated after changes in previous commit
This commit is contained in:
@@ -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 {}
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
data class A(val x: Int) {
|
||||
fun toArray(): IntArray =
|
||||
intArrayOf(x)
|
||||
|
||||
override fun toString() =
|
||||
toArray().takeWhile { it != -1 } // .joinToString()
|
||||
}
|
||||
Vendored
+17
@@ -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 = {}
|
||||
}
|
||||
+8
@@ -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<!>
|
||||
Vendored
+16
@@ -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({})
|
||||
}
|
||||
Reference in New Issue
Block a user