Replace deprecated lambda syntax in testData
It's done with similar constructions where possible trying to preserve intended behavior. Some usages are removed because they test exactly the feature that we are going to drop soon.
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
// KT-306 Ambiguity when different this's have same-looking functions
|
||||
|
||||
fun test() {
|
||||
<!UNUSED_FUNCTION_LITERAL!>{<!DEPRECATED_LAMBDA_SYNTAX!>Foo.()<!> ->
|
||||
bar();
|
||||
{<!DEPRECATED_LAMBDA_SYNTAX!>Barr.()<!> ->
|
||||
(fun Foo.() {
|
||||
bar()
|
||||
(fun Barr.() {
|
||||
this.bar()
|
||||
bar()
|
||||
}
|
||||
}<!>
|
||||
<!UNUSED_FUNCTION_LITERAL!>{<!DEPRECATED_LAMBDA_SYNTAX!>Barr.()<!> ->
|
||||
})
|
||||
})
|
||||
(fun Barr.() {
|
||||
this.bar()
|
||||
bar()
|
||||
}<!>
|
||||
})
|
||||
}
|
||||
|
||||
class Foo {
|
||||
|
||||
@@ -2,18 +2,19 @@
|
||||
|
||||
package kt352
|
||||
|
||||
val f : (Any) -> Unit = { <!DEPRECATED_LAMBDA_SYNTAX!><!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>()<!> : Unit<!> -> } //type mismatch
|
||||
val f : (Any) -> Unit = { <!EXPECTED_PARAMETERS_NUMBER_MISMATCH!><!>-> } //type mismatch
|
||||
|
||||
fun foo() {
|
||||
val <!UNUSED_VARIABLE!>f<!> : (Any) -> Unit = { <!DEPRECATED_LAMBDA_SYNTAX!><!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>()<!> : Unit<!> -> } //!!! no error
|
||||
val <!UNUSED_VARIABLE!>f<!> : (Any) -> Unit = { <!EXPECTED_PARAMETERS_NUMBER_MISMATCH!><!>-> } //!!! no error
|
||||
}
|
||||
|
||||
class A() {
|
||||
val f : (Any) -> Unit = { <!DEPRECATED_LAMBDA_SYNTAX!><!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>()<!> : Unit<!> -> } //type mismatch
|
||||
val f : (Any) -> Unit = { <!EXPECTED_PARAMETERS_NUMBER_MISMATCH!><!>-> } //type mismatch
|
||||
}
|
||||
|
||||
//more tests
|
||||
val g : () -> Unit = { <!DEPRECATED_LAMBDA_SYNTAX!>(): <!EXPECTED_RETURN_TYPE_MISMATCH!>Int<!><!> -> 42 }
|
||||
val g : () -> Unit = { <!UNUSED_EXPRESSION!>42<!> }
|
||||
val gFunction : () -> Unit = <!TYPE_MISMATCH!>fun(): Int = 1<!>
|
||||
|
||||
val h : () -> Unit = { doSmth() }
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package
|
||||
package kt352 {
|
||||
public val f: (kotlin.Any) -> kotlin.Unit
|
||||
public val g: () -> kotlin.Unit
|
||||
public val gFunction: () -> kotlin.Unit
|
||||
public val h: () -> kotlin.Unit
|
||||
public val testIt: (kotlin.Any) -> kotlin.Unit
|
||||
public fun doSmth(): kotlin.Int
|
||||
|
||||
Reference in New Issue
Block a user