FIR: add & use hasExplicitParameterList to anonymous functions

#KT-49134 Fixed
This commit is contained in:
Mikhail Glukhikh
2021-10-15 16:26:37 +03:00
committed by teamcityserver
parent 9307757bb4
commit 29e4c299e7
20 changed files with 38 additions and 16 deletions
@@ -24,9 +24,9 @@ fun test1() {
foo1 <!ARGUMENT_TYPE_MISMATCH!>{
x, <!CANNOT_INFER_PARAMETER_TYPE!>y<!> -> ""
}<!>
foo1 {
foo1 <!ARGUMENT_TYPE_MISMATCH!>{
-> <!ARGUMENT_TYPE_MISMATCH!>42<!>
}
}<!>
foo2 <!ARGUMENT_TYPE_MISMATCH!>{
@@ -1,8 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo(g: () -> Int) {}
fun foo(f: (Int) -> Int) {}
fun test() {
<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!> { -> 42 }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo(g: () -> Int) {}
@@ -130,7 +130,7 @@ fun test4() { // to non-extension lambda 2
}
open class A(a: () -> Unit) {
constructor(f: (String) -> Unit) : <!OVERLOAD_RESOLUTION_AMBIGUITY!>this<!>({ -> f("") })
constructor(f: (String) -> Unit) : this({ -> f("") })
}
class B: A({ s -> "1" })
@@ -2,14 +2,14 @@
package kt352
val f : (Any) -> Unit = { -> } //type mismatch
val f : (Any) -> Unit = <!INITIALIZER_TYPE_MISMATCH!>{ -> }<!> //type mismatch
fun foo() {
val f : (Any) -> Unit = { -> } //!!! no error
val f : (Any) -> Unit = <!INITIALIZER_TYPE_MISMATCH!>{ -> }<!> //!!! no error
}
class A() {
val f : (Any) -> Unit = { -> } //type mismatch
val f : (Any) -> Unit = <!INITIALIZER_TYPE_MISMATCH!>{ -> }<!> //type mismatch
}
//more tests
@@ -25,4 +25,4 @@ val testIt : (Any) -> Unit = {
if (it is String) {
doSmth(it)
}
}
}