Callable reference adaptation should have dependency on API version 1.4

#KT-38069 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-06-26 06:54:21 +03:00
parent bc40669598
commit c5a2ab2512
7 changed files with 69 additions and 0 deletions
@@ -0,0 +1,18 @@
// !API_VERSION: 1.3
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A {
fun foo(s: String = "", vararg xs: Long): String = "foo"
}
fun coercionToUnit(f: (A, String, LongArray) -> Unit): Any = f
fun varargToElement(f: (A, String, Long, Long) -> String): Any = f
fun defaultAndVararg(f: (A) -> String): Any = f
fun allOfTheAbove(f: (A) -> Unit): Any = f
fun test() {
coercionToUnit(<!TYPE_MISMATCH!>A::foo<!>)
varargToElement(<!TYPE_MISMATCH!>A::foo<!>)
defaultAndVararg(<!TYPE_MISMATCH!>A::foo<!>)
allOfTheAbove(<!TYPE_MISMATCH!>A::foo<!>)
}