Fixed test data for new lambda syntax

This commit is contained in:
Stanislav Erokhin
2015-03-18 00:25:06 +03:00
parent 371908a280
commit 43e24f6b0d
54 changed files with 103 additions and 113 deletions
@@ -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})
}
}
}
+2 -2
View File
@@ -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 -1
View File
@@ -1,7 +1,7 @@
package jet121
fun box(): String {
val answer = apply("OK") { String.(): Int ->
val answer = apply("OK") {
get(0)
length()
}
+2 -2
View File
@@ -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)
}
@@ -4,7 +4,7 @@
fun foo() {
any {
(x: String?<caret>?) ->
x: String?<caret>? ->
}
}