no 'dangling function literal' check for nested calls

This commit is contained in:
Svetlana Isakova
2013-06-05 20:31:47 +04:00
parent 4e6ec64d9a
commit ca88a01e1d
4 changed files with 23 additions and 6 deletions
@@ -0,0 +1,28 @@
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() {}
@@ -0,0 +1,11 @@
package baz
fun test() {
<!NONE_APPLICABLE!>foo<!>(1) <!DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED!>{}<!>
foo( <!NONE_APPLICABLE!>foo<!>(1) {} ) //here
}
fun foo(<!UNUSED_PARAMETER!>i<!>: Int) {}
fun foo() : (i : () -> Unit) -> Unit = {}