Files
kotlin-fork/compiler/testData/diagnostics/tests/Varargs.kt
T
Svetlana Isakova 96db2ecabd added different errors instead of ERROR_COMPILE_TIME_VALUE with different text
check type for constants in DataFlowUtils
2013-09-13 16:04:17 +04:00

18 lines
560 B
Kotlin

fun v(<!UNUSED_PARAMETER!>x<!> : Int, <!UNUSED_PARAMETER!>y<!> : String, vararg <!UNUSED_PARAMETER!>f<!> : Long) {}
fun v1(vararg <!UNUSED_PARAMETER!>f<!> : (Int) -> Unit) {}
fun test() {
v(1, "")
v(1, "", 1)
v(1, "", 1, 1, 1)
v(1, "", 1, 1, 1)
v1()
v1({})
v1({}, {})
v1({}, <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>, {})
v1({}, {}, {it})
v1({}) <!VARARG_OUTSIDE_PARENTHESES, DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{}<!>
v1 <!VARARG_OUTSIDE_PARENTHESES, DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{}<!>
}