Files
kotlin/compiler/testData/diagnostics/tests/functionLiterals/DanglingFunctionLiteral.kt
2013-06-06 17:20:10 +04:00

29 lines
507 B
Kotlin

class Foo() {
private val builder = StringBuilder("sdfsd");
{
}
}
class Foo1() {
private val builder = <!NONE_APPLICABLE!>StringBuilder<!>("sdfsd")
<!DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{
}<!>
}
fun foo() = {
<!NONE_APPLICABLE!>println<!>(1)
<!DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{}<!>
}
fun foo1() = {
println(1);
{}
}
fun println(<!UNUSED_PARAMETER!>i<!> : Int) {}
fun println(<!UNUSED_PARAMETER!>s<!> : Byte) {}
fun println() {}