FIR: account for vararg when creating KFunction type for callable reference
This commit is contained in:
committed by
Mikhail Glukhikh
parent
e5e50eabe9
commit
4e14f9500f
Vendored
-1
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
fun foo(s: String = "kotlin", vararg t: String): Boolean {
|
||||
if (s != "kotlin") throw AssertionError(s)
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
fun foo(vararg a: String, result: String = "OK"): String =
|
||||
if (a.size == 0) result else "Fail"
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
fun foo(x: String = "O", vararg y: String): String =
|
||||
if (y.size == 0) x + "K" else "Fail"
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
inline fun foo(x: () -> Unit): String {
|
||||
x()
|
||||
|
||||
Vendored
-1
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
fun foo(vararg l: Long, s: String = "OK"): String =
|
||||
if (l.size == 0) s else "Fail"
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
fun foo(x: String, vararg y: String): String =
|
||||
if (y.size == 0) x + "K" else "Fail"
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
// IGNORE_BACKEND: JS, JS_IR, NATIVE
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// FILE: test.kt
|
||||
|
||||
fun checkEqual(x: Any, y: Any) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
fun useUnit(fn: () -> Unit) {
|
||||
fn.invoke()
|
||||
|
||||
Reference in New Issue
Block a user