Correct report of NO_VALUE_FOR_PARAMETER when function call contains no brackets and lambda at the end #KT-7813 Fixed
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
// See KT-7813: Call to functional parameter with missing argument: no error detected but compiler crashes
|
||||
|
||||
fun foo(p: (Int, () -> Int) -> Unit) {
|
||||
// Errors except last call
|
||||
<!NO_VALUE_FOR_PARAMETER!>p<!> { 1 }
|
||||
p(<!NO_VALUE_FOR_PARAMETER!>)<!> { 2 }
|
||||
p(3) { 4 }
|
||||
}
|
||||
|
||||
fun bar(p: (String, Any, () -> String) -> Unit) {
|
||||
// Errors except last call
|
||||
<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>p<!> { "" }
|
||||
p(<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>)<!> { "x" }
|
||||
p("y"<!NO_VALUE_FOR_PARAMETER!>)<!> { "z" }
|
||||
p("v", Any()) { "w" }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package
|
||||
|
||||
public fun bar(/*0*/ p: (kotlin.String, kotlin.Any, () -> kotlin.String) -> kotlin.Unit): kotlin.Unit
|
||||
public fun foo(/*0*/ p: (kotlin.Int, () -> kotlin.Int) -> kotlin.Unit): kotlin.Unit
|
||||
Reference in New Issue
Block a user