Minor: move callable reference IR tests to a separate directory

This commit is contained in:
Dmitry Petrov
2020-01-21 13:26:12 +03:00
parent c5f14a29a4
commit 38b90b7fbd
17 changed files with 86 additions and 60 deletions
@@ -0,0 +1,22 @@
// !LANGUAGE: +NewInference, +FunctionReferenceWithDefaultValueAsOtherType
import Host.importedObjectMemberWithVarargs
fun use(fn: (Int) -> String) = fn(1)
fun coerceToUnit(fn: (Int) -> Unit) {}
fun fnWithDefault(a: Int, b: Int = 42) = "abc"
fun fnWithVarargs(vararg xs: Int) = "abc"
object Host {
fun importedObjectMemberWithVarargs(vararg xs: Int) = "abc"
}
fun testDefault() = use(::fnWithDefault)
fun testVararg() = use(::fnWithVarargs)
fun testCoercionToUnit() = coerceToUnit(::fnWithDefault)
fun testImportedObjectMember() = use(::importedObjectMemberWithVarargs)