Fixed test data for new lambda syntax
This commit is contained in:
@@ -5,12 +5,12 @@
|
||||
val y = this@A : A
|
||||
val z = this : B
|
||||
val Int.xx : Int get() = this : Int
|
||||
fun Char.xx() : Any {
|
||||
fun Char.xx() : Double.() -> Unit {
|
||||
this : Char
|
||||
val <warning>a</warning> = {Double.() -> this : Double + this@xx : Char}
|
||||
val <warning>b</warning> = @a{Double.() -> this@a : Double + this@xx : Char}
|
||||
val <warning>c</warning> = @a{() -> <error>this@a</error> <error>+</error> this@xx : Char}
|
||||
return (@a{Double.() -> this@a : Double + this@xx : Char})
|
||||
val <warning>a</warning>: Double.() -> Unit = { this : Double + this@xx : Char}
|
||||
val <warning>b</warning>: Double.() -> Unit = @a{this@a : Double + this@xx : Char}
|
||||
val <warning>c</warning> = @a{<error>this@a</error> <error>+</error> this@xx : Char}
|
||||
return (@a{this@a : Double + this@xx : Char})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,8 +173,8 @@ fun returnFunctionLiteralBlock(<info>a</info>: Any?): Function0<Int> {
|
||||
else return { 1 }
|
||||
}
|
||||
fun returnFunctionLiteral(<info>a</info>: Any?): Function0<Int> =
|
||||
if (<info>a</info> is Int) { (): Int -> <info descr="Smart cast to kotlin.Int"><info>a</info></info> }
|
||||
else { () -> 1 }
|
||||
if (<info>a</info> is Int) (fun (): Int = <info descr="Smart cast to kotlin.Int"><info>a</info></info>)
|
||||
else { -> 1 }
|
||||
|
||||
fun mergeSmartCasts(a: Any?) {
|
||||
if (a is String || a is Int) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package jet121
|
||||
|
||||
fun box(): String {
|
||||
val answer = apply("OK") { String.(): Int ->
|
||||
val answer = apply("OK") {
|
||||
get(0)
|
||||
length()
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
fun foo1() : (Int) -> Int = { (x: Int) -> x }
|
||||
fun foo1() : (Int) -> Int = { x: Int -> x }
|
||||
|
||||
fun foo() {
|
||||
val h : (Int) -> Int = foo1();
|
||||
h(1)
|
||||
val m : (Int) -> Int = {(a : Int) -> 1}//foo1()
|
||||
val m : (Int) -> Int = {a : Int -> 1}//foo1()
|
||||
m(1)
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
fun foo() {
|
||||
any {
|
||||
(x: String?<caret>?) ->
|
||||
x: String?<caret>? ->
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user