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:
+14
-14
@@ -1,34 +1,34 @@
|
|||||||
== foo ==
|
== foo ==
|
||||||
fun foo() {
|
fun foo() {
|
||||||
val a = 1
|
val a = 1
|
||||||
val f = { (x: Int) ->
|
val f = { x: Int ->
|
||||||
val y = x + a
|
val y = x + a
|
||||||
use(a)
|
use(a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
L0:
|
L0:
|
||||||
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
|
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
|
||||||
2 mark({ val a = 1 val f = { (x: Int) -> val y = x + a use(a) } })
|
2 mark({ val a = 1 val f = { x: Int -> val y = x + a use(a) } })
|
||||||
v(val a = 1) INIT: in: {} out: {a=D}
|
v(val a = 1) INIT: in: {} out: {a=D}
|
||||||
r(1) -> <v0> INIT: in: {a=D} out: {a=D}
|
r(1) -> <v0> INIT: in: {a=D} out: {a=D}
|
||||||
w(a|<v0>) INIT: in: {a=D} out: {a=ID}
|
w(a|<v0>) INIT: in: {a=D} out: {a=ID}
|
||||||
v(val f = { (x: Int) -> val y = x + a use(a) }) INIT: in: {a=ID} out: {a=ID, f=D}
|
v(val f = { x: Int -> val y = x + a use(a) }) INIT: in: {a=ID} out: {a=ID, f=D}
|
||||||
mark({ (x: Int) -> val y = x + a use(a) }) INIT: in: {a=ID, f=D} out: {a=ID, f=D}
|
mark({ x: Int -> val y = x + a use(a) }) INIT: in: {a=ID, f=D} out: {a=ID, f=D}
|
||||||
jmp?(L2)
|
jmp?(L2)
|
||||||
d({ (x: Int) -> val y = x + a use(a) }) USE: in: {a=READ} out: {a=READ}
|
d({ x: Int -> val y = x + a use(a) }) USE: in: {a=READ} out: {a=READ}
|
||||||
L2 [after local declaration]:
|
L2 [after local declaration]:
|
||||||
r({ (x: Int) -> val y = x + a use(a) }) -> <v1>
|
r({ x: Int -> val y = x + a use(a) }) -> <v1>
|
||||||
w(f|<v1>) INIT: in: {a=ID, f=D} out: {a=ID, f=ID}
|
w(f|<v1>) INIT: in: {a=ID, f=D} out: {a=ID, f=ID}
|
||||||
L1:
|
L1:
|
||||||
1 <END> INIT: in: {} out: {}
|
1 <END> INIT: in: {} out: {}
|
||||||
error:
|
error:
|
||||||
<ERROR>
|
<ERROR>
|
||||||
sink:
|
sink:
|
||||||
<SINK> USE: in: {} out: {}
|
<SINK> USE: in: {} out: {}
|
||||||
=====================
|
=====================
|
||||||
== anonymous_0 ==
|
== anonymous_0 ==
|
||||||
{ (x: Int) ->
|
{ x: Int ->
|
||||||
val y = x + a
|
val y = x + a
|
||||||
use(a)
|
use(a)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
val a = 1
|
val a = 1
|
||||||
val f = { (x: Int) ->
|
val f = { x: Int ->
|
||||||
val y = x + a
|
val y = x + a
|
||||||
use(a)
|
use(a)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
== foo ==
|
== foo ==
|
||||||
fun foo() {
|
fun foo() {
|
||||||
val a = 1
|
val a = 1
|
||||||
val f = { (x: Int) ->
|
val f = { x: Int ->
|
||||||
val y = x + a
|
val y = x + a
|
||||||
use(a)
|
use(a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
1 <v0>: Int NEW: r(1) -> <v0>
|
1 <v0>: Int NEW: r(1) -> <v0>
|
||||||
{ (x: Int) -> val y = x + a use(a) } <v1>: {<: (Int) -> Array<out Any?>} NEW: r({ (x: Int) -> val y = x + a use(a) }) -> <v1>
|
{ x: Int -> val y = x + a use(a) } <v1>: {<: (Int) -> Array<out Any?>} NEW: r({ x: Int -> val y = x + a use(a) }) -> <v1>
|
||||||
=====================
|
=====================
|
||||||
== anonymous_0 ==
|
== anonymous_0 ==
|
||||||
{ (x: Int) ->
|
{ x: Int ->
|
||||||
val y = x + a
|
val y = x + a
|
||||||
use(a)
|
use(a)
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-11
@@ -1,28 +1,28 @@
|
|||||||
== TestFunctionLiteral ==
|
== TestFunctionLiteral ==
|
||||||
class TestFunctionLiteral {
|
class TestFunctionLiteral {
|
||||||
val sum: (Int)->Int = { (x: Int) ->
|
val sum: (Int)->Int = { x: Int ->
|
||||||
sum(x - 1) + x
|
sum(x - 1) + x
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
L0:
|
L0:
|
||||||
1 <START> INIT: in: {} out: {}
|
1 <START> INIT: in: {} out: {}
|
||||||
v(val sum: (Int)->Int = { (x: Int) -> sum(x - 1) + x }) INIT: in: {} out: {sum=D}
|
v(val sum: (Int)->Int = { x: Int -> sum(x - 1) + x }) INIT: in: {} out: {sum=D}
|
||||||
mark({ (x: Int) -> sum(x - 1) + x }) INIT: in: {sum=D} out: {sum=D}
|
mark({ x: Int -> sum(x - 1) + x }) INIT: in: {sum=D} out: {sum=D}
|
||||||
jmp?(L2)
|
jmp?(L2)
|
||||||
d({ (x: Int) -> sum(x - 1) + x }) USE: in: {sum=READ} out: {sum=READ}
|
d({ x: Int -> sum(x - 1) + x }) USE: in: {sum=READ} out: {sum=READ}
|
||||||
L2 [after local declaration]:
|
L2 [after local declaration]:
|
||||||
r({ (x: Int) -> sum(x - 1) + x }) -> <v0>
|
r({ x: Int -> sum(x - 1) + x }) -> <v0>
|
||||||
w(sum|<v0>) INIT: in: {sum=D} out: {sum=ID}
|
w(sum|<v0>) INIT: in: {sum=D} out: {sum=ID}
|
||||||
L1:
|
L1:
|
||||||
<END> INIT: in: {sum=ID} out: {sum=ID}
|
<END> INIT: in: {sum=ID} out: {sum=ID}
|
||||||
error:
|
error:
|
||||||
<ERROR> INIT: in: {} out: {}
|
<ERROR> INIT: in: {} out: {}
|
||||||
sink:
|
sink:
|
||||||
<SINK> INIT: in: {sum=I?D} out: {sum=I?D} USE: in: {} out: {}
|
<SINK> INIT: in: {sum=I?D} out: {sum=I?D} USE: in: {} out: {}
|
||||||
=====================
|
=====================
|
||||||
== anonymous_0 ==
|
== anonymous_0 ==
|
||||||
{ (x: Int) ->
|
{ x: Int ->
|
||||||
sum(x - 1) + x
|
sum(x - 1) + x
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class TestFunctionLiteral {
|
class TestFunctionLiteral {
|
||||||
val sum: (Int)->Int = { (x: Int) ->
|
val sum: (Int)->Int = { x: Int ->
|
||||||
sum(x - 1) + x
|
sum(x - 1) + x
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-12
@@ -1,27 +1,27 @@
|
|||||||
== TestFunctionLiteral ==
|
== TestFunctionLiteral ==
|
||||||
class TestFunctionLiteral {
|
class TestFunctionLiteral {
|
||||||
val sum: (Int)->Int = { (x: Int) ->
|
val sum: (Int)->Int = { x: Int ->
|
||||||
sum(x - 1) + x
|
sum(x - 1) + x
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
{ (x: Int) -> sum(x - 1) + x } <v0>: {<: (Int) -> Int} NEW: r({ (x: Int) -> sum(x - 1) + x }) -> <v0>
|
{ x: Int -> sum(x - 1) + x } <v0>: {<: (Int) -> Int} NEW: r({ x: Int -> sum(x - 1) + x }) -> <v0>
|
||||||
=====================
|
=====================
|
||||||
== anonymous_0 ==
|
== anonymous_0 ==
|
||||||
{ (x: Int) ->
|
{ x: Int ->
|
||||||
sum(x - 1) + x
|
sum(x - 1) + x
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
<v0>: Int NEW: magic[FAKE_INITIALIZER](x: Int) -> <v0>
|
<v0>: Int NEW: magic[FAKE_INITIALIZER](x: Int) -> <v0>
|
||||||
<v1>: TestFunctionLiteral NEW: magic[IMPLICIT_RECEIVER](sum) -> <v1>
|
<v1>: TestFunctionLiteral NEW: magic[IMPLICIT_RECEIVER](sum) -> <v1>
|
||||||
sum <v2>: {<: (Int) -> Int} NEW: r(sum|<v1>) -> <v2>
|
sum <v2>: {<: (Int) -> Int} NEW: r(sum|<v1>) -> <v2>
|
||||||
x <v3>: Int NEW: r(x) -> <v3>
|
x <v3>: Int NEW: r(x) -> <v3>
|
||||||
1 <v4>: Int NEW: r(1) -> <v4>
|
1 <v4>: Int NEW: r(1) -> <v4>
|
||||||
x - 1 <v5>: Int NEW: call(x - 1, minus|<v3>, <v4>) -> <v5>
|
x - 1 <v5>: Int NEW: call(x - 1, minus|<v3>, <v4>) -> <v5>
|
||||||
sum(x - 1) <v6>: Int NEW: call(sum(x - 1), invoke|<v2>, <v5>) -> <v6>
|
sum(x - 1) <v6>: Int NEW: call(sum(x - 1), invoke|<v2>, <v5>) -> <v6>
|
||||||
x <v7>: Int NEW: r(x) -> <v7>
|
x <v7>: Int NEW: r(x) -> <v7>
|
||||||
sum(x - 1) + x <v8>: Int NEW: call(sum(x - 1) + x, plus|<v6>, <v7>) -> <v8>
|
sum(x - 1) + x <v8>: Int NEW: call(sum(x - 1) + x, plus|<v6>, <v7>) -> <v8>
|
||||||
sum(x - 1) + x <v8>: Int COPY
|
sum(x - 1) + x <v8>: Int COPY
|
||||||
=====================
|
=====================
|
||||||
== A ==
|
== A ==
|
||||||
open class A(val a: A)
|
open class A(val a: A)
|
||||||
|
|||||||
+16
-16
@@ -2,38 +2,38 @@
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
"before"
|
"before"
|
||||||
val b = 1
|
val b = 1
|
||||||
val f = { (x: Int) ->
|
val f = { x: Int ->
|
||||||
val a = x + b
|
val a = x + b
|
||||||
}
|
}
|
||||||
"after"
|
"after"
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
L0:
|
L0:
|
||||||
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
|
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
|
||||||
2 mark({ "before" val b = 1 val f = { (x: Int) -> val a = x + b } "after" })
|
2 mark({ "before" val b = 1 val f = { x: Int -> val a = x + b } "after" })
|
||||||
mark("before")
|
mark("before")
|
||||||
r("before") -> <v0>
|
r("before") -> <v0>
|
||||||
v(val b = 1) INIT: in: {} out: {b=D}
|
v(val b = 1) INIT: in: {} out: {b=D}
|
||||||
r(1) -> <v1> INIT: in: {b=D} out: {b=D}
|
r(1) -> <v1> INIT: in: {b=D} out: {b=D}
|
||||||
w(b|<v1>) INIT: in: {b=D} out: {b=ID}
|
w(b|<v1>) INIT: in: {b=D} out: {b=ID}
|
||||||
v(val f = { (x: Int) -> val a = x + b }) INIT: in: {b=ID} out: {b=ID, f=D}
|
v(val f = { x: Int -> val a = x + b }) INIT: in: {b=ID} out: {b=ID, f=D}
|
||||||
mark({ (x: Int) -> val a = x + b }) INIT: in: {b=ID, f=D} out: {b=ID, f=D}
|
mark({ x: Int -> val a = x + b }) INIT: in: {b=ID, f=D} out: {b=ID, f=D}
|
||||||
jmp?(L2)
|
jmp?(L2)
|
||||||
d({ (x: Int) -> val a = x + b }) USE: in: {b=READ} out: {b=READ}
|
d({ x: Int -> val a = x + b }) USE: in: {b=READ} out: {b=READ}
|
||||||
L2 [after local declaration]:
|
L2 [after local declaration]:
|
||||||
r({ (x: Int) -> val a = x + b }) -> <v2>
|
r({ x: Int -> val a = x + b }) -> <v2>
|
||||||
w(f|<v2>) INIT: in: {b=ID, f=D} out: {b=ID, f=ID}
|
w(f|<v2>) INIT: in: {b=ID, f=D} out: {b=ID, f=ID}
|
||||||
mark("after") INIT: in: {b=ID, f=ID} out: {b=ID, f=ID}
|
mark("after") INIT: in: {b=ID, f=ID} out: {b=ID, f=ID}
|
||||||
r("after") -> <v3>
|
r("after") -> <v3>
|
||||||
L1:
|
L1:
|
||||||
1 <END> INIT: in: {} out: {}
|
1 <END> INIT: in: {} out: {}
|
||||||
error:
|
error:
|
||||||
<ERROR>
|
<ERROR>
|
||||||
sink:
|
sink:
|
||||||
<SINK> USE: in: {} out: {}
|
<SINK> USE: in: {} out: {}
|
||||||
=====================
|
=====================
|
||||||
== anonymous_0 ==
|
== anonymous_0 ==
|
||||||
{ (x: Int) ->
|
{ x: Int ->
|
||||||
val a = x + b
|
val a = x + b
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
@@ -55,4 +55,4 @@ error:
|
|||||||
<ERROR> INIT: in: {} out: {}
|
<ERROR> INIT: in: {} out: {}
|
||||||
sink:
|
sink:
|
||||||
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
|
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
|
||||||
=====================
|
=====================
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
"before"
|
"before"
|
||||||
val b = 1
|
val b = 1
|
||||||
val f = { (x: Int) ->
|
val f = { x: Int ->
|
||||||
val a = x + b
|
val a = x + b
|
||||||
}
|
}
|
||||||
"after"
|
"after"
|
||||||
|
|||||||
@@ -2,20 +2,20 @@
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
"before"
|
"before"
|
||||||
val b = 1
|
val b = 1
|
||||||
val f = { (x: Int) ->
|
val f = { x: Int ->
|
||||||
val a = x + b
|
val a = x + b
|
||||||
}
|
}
|
||||||
"after"
|
"after"
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
"before" <v0>: * NEW: r("before") -> <v0>
|
"before" <v0>: * NEW: r("before") -> <v0>
|
||||||
1 <v1>: Int NEW: r(1) -> <v1>
|
1 <v1>: Int NEW: r(1) -> <v1>
|
||||||
{ (x: Int) -> val a = x + b } <v2>: {<: (Int) -> Unit} NEW: r({ (x: Int) -> val a = x + b }) -> <v2>
|
{ x: Int -> val a = x + b } <v2>: {<: (Int) -> Unit} NEW: r({ x: Int -> val a = x + b }) -> <v2>
|
||||||
"after" <v3>: * NEW: r("after") -> <v3>
|
"after" <v3>: * NEW: r("after") -> <v3>
|
||||||
{ "before" val b = 1 val f = { (x: Int) -> val a = x + b } "after" } <v3>: * COPY
|
{ "before" val b = 1 val f = { x: Int -> val a = x + b } "after" } <v3>: * COPY
|
||||||
=====================
|
=====================
|
||||||
== anonymous_0 ==
|
== anonymous_0 ==
|
||||||
{ (x: Int) ->
|
{ x: Int ->
|
||||||
val a = x + b
|
val a = x + b
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
|
|||||||
+30
-30
@@ -89,7 +89,7 @@ sink:
|
|||||||
fun t3() {
|
fun t3() {
|
||||||
try {
|
try {
|
||||||
1
|
1
|
||||||
l@{ () ->
|
l@{ ->
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
return@l
|
return@l
|
||||||
}
|
}
|
||||||
@@ -101,38 +101,38 @@ fun t3() {
|
|||||||
---------------------
|
---------------------
|
||||||
L0:
|
L0:
|
||||||
1 <START>
|
1 <START>
|
||||||
2 mark({ try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 } })
|
2 mark({ try { 1 l@{ -> if (2 > 3) { return@l } } } finally { 2 } })
|
||||||
mark(try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 })
|
mark(try { 1 l@{ -> if (2 > 3) { return@l } } } finally { 2 })
|
||||||
jmp?(L2) NEXT:[mark({ 2 }), mark({ 1 l@{ () -> if (2 > 3) { return@l } } })]
|
jmp?(L2) NEXT:[mark({ 2 }), mark({ 1 l@{ -> if (2 > 3) { return@l } } })]
|
||||||
3 mark({ 1 l@{ () -> if (2 > 3) { return@l } } })
|
3 mark({ 1 l@{ -> if (2 > 3) { return@l } } })
|
||||||
r(1) -> <v0>
|
r(1) -> <v0>
|
||||||
mark(l@{ () -> if (2 > 3) { return@l } })
|
mark(l@{ -> if (2 > 3) { return@l } })
|
||||||
mark({ () -> if (2 > 3) { return@l } })
|
mark({ -> if (2 > 3) { return@l } })
|
||||||
jmp?(L3) NEXT:[r({ () -> if (2 > 3) { return@l } }) -> <v1>, d({ () -> if (2 > 3) { return@l } })]
|
jmp?(L3) NEXT:[r({ -> if (2 > 3) { return@l } }) -> <v1>, d({ -> if (2 > 3) { return@l } })]
|
||||||
d({ () -> if (2 > 3) { return@l } }) NEXT:[<SINK>]
|
d({ -> if (2 > 3) { return@l } }) NEXT:[<SINK>]
|
||||||
L3 [after local declaration]:
|
L3 [after local declaration]:
|
||||||
r({ () -> if (2 > 3) { return@l } }) -> <v1> PREV:[jmp?(L3)]
|
r({ -> if (2 > 3) { return@l } }) -> <v1> PREV:[jmp?(L3)]
|
||||||
2 jmp(L8) NEXT:[mark({ 2 })]
|
2 jmp(L8) NEXT:[mark({ 2 })]
|
||||||
L2 [onExceptionToFinallyBlock]:
|
L2 [onExceptionToFinallyBlock]:
|
||||||
L9 [start finally]:
|
L9 [start finally]:
|
||||||
3 mark({ 2 }) PREV:[jmp?(L2)]
|
3 mark({ 2 }) PREV:[jmp?(L2)]
|
||||||
r(2) -> <v2>
|
r(2) -> <v2>
|
||||||
L10 [finish finally]:
|
L10 [finish finally]:
|
||||||
2 jmp(error) NEXT:[<ERROR>]
|
2 jmp(error) NEXT:[<ERROR>]
|
||||||
L8 [skipFinallyToErrorBlock]:
|
L8 [skipFinallyToErrorBlock]:
|
||||||
L11 [copy of L2, onExceptionToFinallyBlock]:
|
L11 [copy of L2, onExceptionToFinallyBlock]:
|
||||||
3 mark({ 2 }) PREV:[jmp(L8)]
|
3 mark({ 2 }) PREV:[jmp(L8)]
|
||||||
r(2) -> <v2>
|
r(2) -> <v2>
|
||||||
2 merge(try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 }|<v1>) -> <v3>
|
2 merge(try { 1 l@{ -> if (2 > 3) { return@l } } } finally { 2 }|<v1>) -> <v3>
|
||||||
L1:
|
L1:
|
||||||
1 <END> NEXT:[<SINK>]
|
1 <END> NEXT:[<SINK>]
|
||||||
error:
|
error:
|
||||||
<ERROR> PREV:[jmp(error)]
|
<ERROR> PREV:[jmp(error)]
|
||||||
sink:
|
sink:
|
||||||
<SINK> PREV:[<ERROR>, <END>, d({ () -> if (2 > 3) { return@l } })]
|
<SINK> PREV:[<ERROR>, <END>, d({ -> if (2 > 3) { return@l } })]
|
||||||
=====================
|
=====================
|
||||||
== anonymous_0 ==
|
== anonymous_0 ==
|
||||||
{ () ->
|
{ ->
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
return@l
|
return@l
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ sink:
|
|||||||
=====================
|
=====================
|
||||||
== t4 ==
|
== t4 ==
|
||||||
fun t4() {
|
fun t4() {
|
||||||
l@{ () ->
|
l@{ ->
|
||||||
try {
|
try {
|
||||||
1
|
1
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
@@ -177,22 +177,22 @@ fun t4() {
|
|||||||
---------------------
|
---------------------
|
||||||
L0:
|
L0:
|
||||||
1 <START>
|
1 <START>
|
||||||
2 mark({ l@{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } })
|
2 mark({ l@{ -> try { 1 if (2 > 3) { return@l } } finally { 2 } } })
|
||||||
mark(l@{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } })
|
mark(l@{ -> try { 1 if (2 > 3) { return@l } } finally { 2 } })
|
||||||
mark({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } })
|
mark({ -> try { 1 if (2 > 3) { return@l } } finally { 2 } })
|
||||||
jmp?(L2) NEXT:[r({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) -> <v0>, d({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } })]
|
jmp?(L2) NEXT:[r({ -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) -> <v0>, d({ -> try { 1 if (2 > 3) { return@l } } finally { 2 } })]
|
||||||
d({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) NEXT:[<SINK>]
|
d({ -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) NEXT:[<SINK>]
|
||||||
L2 [after local declaration]:
|
L2 [after local declaration]:
|
||||||
r({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) -> <v0> PREV:[jmp?(L2)]
|
r({ -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) -> <v0> PREV:[jmp?(L2)]
|
||||||
L1:
|
L1:
|
||||||
1 <END> NEXT:[<SINK>]
|
1 <END> NEXT:[<SINK>]
|
||||||
error:
|
error:
|
||||||
<ERROR> PREV:[]
|
<ERROR> PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> PREV:[<ERROR>, <END>, d({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } })]
|
<SINK> PREV:[<ERROR>, <END>, d({ -> try { 1 if (2 > 3) { return@l } } finally { 2 } })]
|
||||||
=====================
|
=====================
|
||||||
== anonymous_1 ==
|
== anonymous_1 ==
|
||||||
{ () ->
|
{ ->
|
||||||
try {
|
try {
|
||||||
1
|
1
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
|
|||||||
+2
-2
@@ -20,7 +20,7 @@ fun t2() {
|
|||||||
fun t3() {
|
fun t3() {
|
||||||
try {
|
try {
|
||||||
1
|
1
|
||||||
l@{ () ->
|
l@{ ->
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
return@l
|
return@l
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ fun t3() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun t4() {
|
fun t4() {
|
||||||
l@{ () ->
|
l@{ ->
|
||||||
try {
|
try {
|
||||||
1
|
1
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
|
|||||||
+75
-75
@@ -43,7 +43,7 @@ try { 1 if (2 > 3) { return } } finally { 2 } <v7>: *
|
|||||||
fun t3() {
|
fun t3() {
|
||||||
try {
|
try {
|
||||||
1
|
1
|
||||||
l@{ () ->
|
l@{ ->
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
return@l
|
return@l
|
||||||
}
|
}
|
||||||
@@ -53,33 +53,33 @@ fun t3() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
1 <v0>: * NEW: r(1) -> <v0>
|
1 <v0>: * NEW: r(1) -> <v0>
|
||||||
{ () -> if (2 > 3) { return@l } } <v1>: * NEW: r({ () -> if (2 > 3) { return@l } }) -> <v1>
|
{ -> if (2 > 3) { return@l } } <v1>: * NEW: r({ -> if (2 > 3) { return@l } }) -> <v1>
|
||||||
l@{ () -> if (2 > 3) { return@l } } <v1>: * COPY
|
l@{ -> if (2 > 3) { return@l } } <v1>: * COPY
|
||||||
{ 1 l@{ () -> if (2 > 3) { return@l } } } <v1>: * COPY
|
{ 1 l@{ -> if (2 > 3) { return@l } } } <v1>: * COPY
|
||||||
2 <v2>: * NEW: r(2) -> <v2>
|
2 <v2>: * NEW: r(2) -> <v2>
|
||||||
{ 2 } <v2>: * COPY
|
{ 2 } <v2>: * COPY
|
||||||
try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 } <v3>: * NEW: merge(try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 }|<v1>) -> <v3>
|
try { 1 l@{ -> if (2 > 3) { return@l } } } finally { 2 } <v3>: * NEW: merge(try { 1 l@{ -> if (2 > 3) { return@l } } } finally { 2 }|<v1>) -> <v3>
|
||||||
{ try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 } } <v3>: * COPY
|
{ try { 1 l@{ -> if (2 > 3) { return@l } } } finally { 2 } } <v3>: * COPY
|
||||||
=====================
|
=====================
|
||||||
== anonymous_0 ==
|
== anonymous_0 ==
|
||||||
{ () ->
|
{ ->
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
return@l
|
return@l
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
2 <v0>: {<: Comparable<Int>} NEW: r(2) -> <v0>
|
2 <v0>: {<: Comparable<Int>} NEW: r(2) -> <v0>
|
||||||
3 <v1>: Int NEW: r(3) -> <v1>
|
3 <v1>: Int NEW: r(3) -> <v1>
|
||||||
2 > 3 <v2>: Boolean NEW: call(2 > 3, compareTo|<v0>, <v1>) -> <v2>
|
2 > 3 <v2>: Boolean NEW: call(2 > 3, compareTo|<v0>, <v1>) -> <v2>
|
||||||
return@l !<v3>: *
|
return@l !<v3>: *
|
||||||
{ return@l } !<v3>: * COPY
|
{ return@l } !<v3>: * COPY
|
||||||
if (2 > 3) { return@l } <v4>: * NEW: merge(if (2 > 3) { return@l }|!<v3>) -> <v4>
|
if (2 > 3) { return@l } <v4>: * NEW: merge(if (2 > 3) { return@l }|!<v3>) -> <v4>
|
||||||
if (2 > 3) { return@l } <v4>: * COPY
|
if (2 > 3) { return@l } <v4>: * COPY
|
||||||
=====================
|
=====================
|
||||||
== t4 ==
|
== t4 ==
|
||||||
fun t4() {
|
fun t4() {
|
||||||
l@{ () ->
|
l@{ ->
|
||||||
try {
|
try {
|
||||||
1
|
1
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
@@ -91,12 +91,12 @@ fun t4() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } <v0>: * NEW: r({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) -> <v0>
|
{ -> try { 1 if (2 > 3) { return@l } } finally { 2 } } <v0>: * NEW: r({ -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) -> <v0>
|
||||||
l@{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } <v0>: * COPY
|
l@{ -> try { 1 if (2 > 3) { return@l } } finally { 2 } } <v0>: * COPY
|
||||||
{ l@{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } } <v0>: * COPY
|
{ l@{ -> try { 1 if (2 > 3) { return@l } } finally { 2 } } } <v0>: * COPY
|
||||||
=====================
|
=====================
|
||||||
== anonymous_1 ==
|
== anonymous_1 ==
|
||||||
{ () ->
|
{ ->
|
||||||
try {
|
try {
|
||||||
1
|
1
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
@@ -107,16 +107,16 @@ l@{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } <v0>: * COPY
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
1 <v0>: * NEW: r(1) -> <v0>
|
1 <v0>: * NEW: r(1) -> <v0>
|
||||||
2 <v1>: {<: Comparable<Int>} NEW: r(2) -> <v1>
|
2 <v1>: {<: Comparable<Int>} NEW: r(2) -> <v1>
|
||||||
3 <v2>: Int NEW: r(3) -> <v2>
|
3 <v2>: Int NEW: r(3) -> <v2>
|
||||||
2 > 3 <v3>: Boolean NEW: call(2 > 3, compareTo|<v1>, <v2>) -> <v3>
|
2 > 3 <v3>: Boolean NEW: call(2 > 3, compareTo|<v1>, <v2>) -> <v3>
|
||||||
return@l !<v5>: *
|
return@l !<v5>: *
|
||||||
{ return@l } !<v5>: * COPY
|
{ return@l } !<v5>: * COPY
|
||||||
if (2 > 3) { return@l } <v6>: * NEW: merge(if (2 > 3) { return@l }|!<v5>) -> <v6>
|
if (2 > 3) { return@l } <v6>: * NEW: merge(if (2 > 3) { return@l }|!<v5>) -> <v6>
|
||||||
{ 1 if (2 > 3) { return@l } } <v6>: * COPY
|
{ 1 if (2 > 3) { return@l } } <v6>: * COPY
|
||||||
2 <v4>: * NEW: r(2) -> <v4>
|
2 <v4>: * NEW: r(2) -> <v4>
|
||||||
{ 2 } <v4>: * COPY
|
{ 2 } <v4>: * COPY
|
||||||
try { 1 if (2 > 3) { return@l } } finally { 2 } <v7>: * NEW: merge(try { 1 if (2 > 3) { return@l } } finally { 2 }|<v6>) -> <v7>
|
try { 1 if (2 > 3) { return@l } } finally { 2 } <v7>: * NEW: merge(try { 1 if (2 > 3) { return@l } } finally { 2 }|<v6>) -> <v7>
|
||||||
try { 1 if (2 > 3) { return@l } } finally { 2 } <v7>: * COPY
|
try { 1 if (2 > 3) { return@l } } finally { 2 } <v7>: * COPY
|
||||||
=====================
|
=====================
|
||||||
@@ -140,17 +140,17 @@ true <v0>: Bo
|
|||||||
2 <v3>: {<: Comparable<Int>} NEW: r(2) -> <v3>
|
2 <v3>: {<: Comparable<Int>} NEW: r(2) -> <v3>
|
||||||
3 <v4>: Int NEW: r(3) -> <v4>
|
3 <v4>: Int NEW: r(3) -> <v4>
|
||||||
2 > 3 <v5>: Boolean NEW: call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
2 > 3 <v5>: Boolean NEW: call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
||||||
break@l !<v7>: *
|
break@l !<v7>: *
|
||||||
{ break@l } !<v7>: * COPY
|
{ break@l } !<v7>: * COPY
|
||||||
if (2 > 3) { break@l } <v8>: * NEW: merge(if (2 > 3) { break@l }|!<v7>) -> <v8>
|
if (2 > 3) { break@l } <v8>: * NEW: merge(if (2 > 3) { break@l }|!<v7>) -> <v8>
|
||||||
{ 1 if (2 > 3) { break@l } } <v8>: * COPY
|
{ 1 if (2 > 3) { break@l } } <v8>: * COPY
|
||||||
2 <v6>: * NEW: r(2) -> <v6>
|
2 <v6>: * NEW: r(2) -> <v6>
|
||||||
{ 2 } <v6>: * COPY
|
{ 2 } <v6>: * COPY
|
||||||
try { 1 if (2 > 3) { break@l } } finally { 2 } <v9>: * NEW: merge(try { 1 if (2 > 3) { break@l } } finally { 2 }|<v8>) -> <v9>
|
try { 1 if (2 > 3) { break@l } } finally { 2 } <v9>: * NEW: merge(try { 1 if (2 > 3) { break@l } } finally { 2 }|<v8>) -> <v9>
|
||||||
{ try { 1 if (2 > 3) { break@l } } finally { 2 } } <v9>: * COPY
|
{ try { 1 if (2 > 3) { break@l } } finally { 2 } } <v9>: * COPY
|
||||||
while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } } !<v10>: *
|
while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } } !<v10>: *
|
||||||
l@ while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } } !<v10>: * COPY
|
l@ while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } } !<v10>: * COPY
|
||||||
{ l@ while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } } } !<v10>: * COPY
|
{ l@ while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } } } !<v10>: * COPY
|
||||||
=====================
|
=====================
|
||||||
== t6 ==
|
== t6 ==
|
||||||
fun t6() {
|
fun t6() {
|
||||||
@@ -173,18 +173,18 @@ true <v0>:
|
|||||||
2 <v3>: {<: Comparable<Int>} NEW: r(2) -> <v3>
|
2 <v3>: {<: Comparable<Int>} NEW: r(2) -> <v3>
|
||||||
3 <v4>: Int NEW: r(3) -> <v4>
|
3 <v4>: Int NEW: r(3) -> <v4>
|
||||||
2 > 3 <v5>: Boolean NEW: call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
2 > 3 <v5>: Boolean NEW: call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
||||||
break@l !<v6>: *
|
break@l !<v6>: *
|
||||||
{ break@l } !<v6>: * COPY
|
{ break@l } !<v6>: * COPY
|
||||||
if (2 > 3) { break@l } <v7>: * NEW: merge(if (2 > 3) { break@l }|!<v6>) -> <v7>
|
if (2 > 3) { break@l } <v7>: * NEW: merge(if (2 > 3) { break@l }|!<v6>) -> <v7>
|
||||||
{ 1 if (2 > 3) { break@l } } <v7>: * COPY
|
{ 1 if (2 > 3) { break@l } } <v7>: * COPY
|
||||||
while(true) { 1 if (2 > 3) { break@l } } !<v8>: *
|
while(true) { 1 if (2 > 3) { break@l } } !<v8>: *
|
||||||
l@ while(true) { 1 if (2 > 3) { break@l } } !<v8>: * COPY
|
l@ while(true) { 1 if (2 > 3) { break@l } } !<v8>: * COPY
|
||||||
5 <v9>: * NEW: r(5) -> <v9>
|
5 <v9>: * NEW: r(5) -> <v9>
|
||||||
{ l@ while(true) { 1 if (2 > 3) { break@l } } 5 } <v9>: * COPY
|
{ l@ while(true) { 1 if (2 > 3) { break@l } } 5 } <v9>: * COPY
|
||||||
2 <v10>: * NEW: r(2) -> <v10>
|
2 <v10>: * NEW: r(2) -> <v10>
|
||||||
{ 2 } <v10>: * COPY
|
{ 2 } <v10>: * COPY
|
||||||
try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 } <v11>: * NEW: merge(try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 }|<v9>) -> <v11>
|
try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 } <v11>: * NEW: merge(try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 }|<v9>) -> <v11>
|
||||||
{ try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 } } <v11>: * COPY
|
{ try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 } } <v11>: * COPY
|
||||||
=====================
|
=====================
|
||||||
== t7 ==
|
== t7 ==
|
||||||
fun t7() {
|
fun t7() {
|
||||||
@@ -206,17 +206,17 @@ true <v0>: Bo
|
|||||||
2 <v3>: {<: Comparable<Int>} NEW: r(2) -> <v3>
|
2 <v3>: {<: Comparable<Int>} NEW: r(2) -> <v3>
|
||||||
3 <v4>: Int NEW: r(3) -> <v4>
|
3 <v4>: Int NEW: r(3) -> <v4>
|
||||||
2 > 3 <v5>: Boolean NEW: call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
2 > 3 <v5>: Boolean NEW: call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
||||||
break@l !<v6>: *
|
break@l !<v6>: *
|
||||||
{ break@l } !<v6>: * COPY
|
{ break@l } !<v6>: * COPY
|
||||||
if (2 > 3) { break@l } <v7>: * NEW: merge(if (2 > 3) { break@l }|!<v6>) -> <v7>
|
if (2 > 3) { break@l } <v7>: * NEW: merge(if (2 > 3) { break@l }|!<v6>) -> <v7>
|
||||||
{ 1 if (2 > 3) { break@l } } <v7>: * COPY
|
{ 1 if (2 > 3) { break@l } } <v7>: * COPY
|
||||||
while(true) { 1 if (2 > 3) { break@l } } !<v8>: *
|
while(true) { 1 if (2 > 3) { break@l } } !<v8>: *
|
||||||
l@ while(true) { 1 if (2 > 3) { break@l } } !<v8>: * COPY
|
l@ while(true) { 1 if (2 > 3) { break@l } } !<v8>: * COPY
|
||||||
{ l@ while(true) { 1 if (2 > 3) { break@l } } } !<v8>: * COPY
|
{ l@ while(true) { 1 if (2 > 3) { break@l } } } !<v8>: * COPY
|
||||||
2 <v9>: * NEW: r(2) -> <v9>
|
2 <v9>: * NEW: r(2) -> <v9>
|
||||||
{ 2 } <v9>: * COPY
|
{ 2 } <v9>: * COPY
|
||||||
try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 } <v10>: * NEW: merge(try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 }|!<v8>) -> <v10>
|
try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 } <v10>: * NEW: merge(try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 }|!<v8>) -> <v10>
|
||||||
{ try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 } } <v10>: * COPY
|
{ try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 } } <v10>: * COPY
|
||||||
=====================
|
=====================
|
||||||
== t8 ==
|
== t8 ==
|
||||||
fun t8(a : Int) {
|
fun t8(a : Int) {
|
||||||
@@ -241,17 +241,17 @@ a <
|
|||||||
2 <v6>: {<: Comparable<Int>} NEW: r(2) -> <v6>
|
2 <v6>: {<: Comparable<Int>} NEW: r(2) -> <v6>
|
||||||
3 <v7>: Int NEW: r(3) -> <v7>
|
3 <v7>: Int NEW: r(3) -> <v7>
|
||||||
2 > 3 <v8>: Boolean NEW: call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
2 > 3 <v8>: Boolean NEW: call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
||||||
continue@l !<v10>: *
|
continue@l !<v10>: *
|
||||||
{ continue@l } !<v10>: * COPY
|
{ continue@l } !<v10>: * COPY
|
||||||
if (2 > 3) { continue@l } <v11>: * NEW: merge(if (2 > 3) { continue@l }|!<v10>) -> <v11>
|
if (2 > 3) { continue@l } <v11>: * NEW: merge(if (2 > 3) { continue@l }|!<v10>) -> <v11>
|
||||||
{ 1 if (2 > 3) { continue@l } } <v11>: * COPY
|
{ 1 if (2 > 3) { continue@l } } <v11>: * COPY
|
||||||
2 <v9>: * NEW: r(2) -> <v9>
|
2 <v9>: * NEW: r(2) -> <v9>
|
||||||
{ 2 } <v9>: * COPY
|
{ 2 } <v9>: * COPY
|
||||||
try { 1 if (2 > 3) { continue@l } } finally { 2 } <v12>: * NEW: merge(try { 1 if (2 > 3) { continue@l } } finally { 2 }|<v11>) -> <v12>
|
try { 1 if (2 > 3) { continue@l } } finally { 2 } <v12>: * NEW: merge(try { 1 if (2 > 3) { continue@l } } finally { 2 }|<v11>) -> <v12>
|
||||||
{ try { 1 if (2 > 3) { continue@l } } finally { 2 } } <v12>: * COPY
|
{ try { 1 if (2 > 3) { continue@l } } finally { 2 } } <v12>: * COPY
|
||||||
for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } } !<v13>: *
|
for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } } !<v13>: *
|
||||||
l@ for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } } !<v13>: * COPY
|
l@ for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } } !<v13>: * COPY
|
||||||
{ l@ for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } } } !<v13>: * COPY
|
{ l@ for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } } } !<v13>: * COPY
|
||||||
=====================
|
=====================
|
||||||
== t9 ==
|
== t9 ==
|
||||||
fun t9(a : Int) {
|
fun t9(a : Int) {
|
||||||
@@ -277,18 +277,18 @@ a
|
|||||||
2 <v6>: {<: Comparable<Int>} NEW: r(2) -> <v6>
|
2 <v6>: {<: Comparable<Int>} NEW: r(2) -> <v6>
|
||||||
3 <v7>: Int NEW: r(3) -> <v7>
|
3 <v7>: Int NEW: r(3) -> <v7>
|
||||||
2 > 3 <v8>: Boolean NEW: call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
2 > 3 <v8>: Boolean NEW: call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
||||||
continue@l !<v9>: *
|
continue@l !<v9>: *
|
||||||
{ continue@l } !<v9>: * COPY
|
{ continue@l } !<v9>: * COPY
|
||||||
if (2 > 3) { continue@l } <v10>: * NEW: merge(if (2 > 3) { continue@l }|!<v9>) -> <v10>
|
if (2 > 3) { continue@l } <v10>: * NEW: merge(if (2 > 3) { continue@l }|!<v9>) -> <v10>
|
||||||
{ 1 if (2 > 3) { continue@l } } <v10>: * COPY
|
{ 1 if (2 > 3) { continue@l } } <v10>: * COPY
|
||||||
for (i in 1..a) { 1 if (2 > 3) { continue@l } } !<v11>: *
|
for (i in 1..a) { 1 if (2 > 3) { continue@l } } !<v11>: *
|
||||||
l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } !<v11>: * COPY
|
l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } !<v11>: * COPY
|
||||||
5 <v12>: * NEW: r(5) -> <v12>
|
5 <v12>: * NEW: r(5) -> <v12>
|
||||||
{ l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } <v12>: * COPY
|
{ l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } <v12>: * COPY
|
||||||
2 <v13>: * NEW: r(2) -> <v13>
|
2 <v13>: * NEW: r(2) -> <v13>
|
||||||
{ 2 } <v13>: * COPY
|
{ 2 } <v13>: * COPY
|
||||||
try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 } <v14>: * NEW: merge(try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 }|<v12>) -> <v14>
|
try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 } <v14>: * NEW: merge(try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 }|<v12>) -> <v14>
|
||||||
{ try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 } } <v14>: * COPY
|
{ try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 } } <v14>: * COPY
|
||||||
=====================
|
=====================
|
||||||
== t10 ==
|
== t10 ==
|
||||||
fun t10(a : Int) {
|
fun t10(a : Int) {
|
||||||
@@ -313,17 +313,17 @@ a <
|
|||||||
2 <v6>: {<: Comparable<Int>} NEW: r(2) -> <v6>
|
2 <v6>: {<: Comparable<Int>} NEW: r(2) -> <v6>
|
||||||
3 <v7>: Int NEW: r(3) -> <v7>
|
3 <v7>: Int NEW: r(3) -> <v7>
|
||||||
2 > 3 <v8>: Boolean NEW: call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
2 > 3 <v8>: Boolean NEW: call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
||||||
continue@l !<v9>: *
|
continue@l !<v9>: *
|
||||||
{ continue@l } !<v9>: * COPY
|
{ continue@l } !<v9>: * COPY
|
||||||
if (2 > 3) { continue@l } <v10>: * NEW: merge(if (2 > 3) { continue@l }|!<v9>) -> <v10>
|
if (2 > 3) { continue@l } <v10>: * NEW: merge(if (2 > 3) { continue@l }|!<v9>) -> <v10>
|
||||||
{ 1 if (2 > 3) { continue@l } } <v10>: * COPY
|
{ 1 if (2 > 3) { continue@l } } <v10>: * COPY
|
||||||
for (i in 1..a) { 1 if (2 > 3) { continue@l } } !<v11>: *
|
for (i in 1..a) { 1 if (2 > 3) { continue@l } } !<v11>: *
|
||||||
l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } !<v11>: * COPY
|
l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } !<v11>: * COPY
|
||||||
{ l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } !<v11>: * COPY
|
{ l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } !<v11>: * COPY
|
||||||
2 <v12>: * NEW: r(2) -> <v12>
|
2 <v12>: * NEW: r(2) -> <v12>
|
||||||
{ 2 } <v12>: * COPY
|
{ 2 } <v12>: * COPY
|
||||||
try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 } <v13>: * NEW: merge(try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 }|!<v11>) -> <v13>
|
try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 } <v13>: * NEW: merge(try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 }|!<v11>) -> <v13>
|
||||||
{ try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 } } <v13>: * COPY
|
{ try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 } } <v13>: * COPY
|
||||||
=====================
|
=====================
|
||||||
== t11 ==
|
== t11 ==
|
||||||
fun t11() {
|
fun t11() {
|
||||||
|
|||||||
@@ -5,5 +5,3 @@ fun test(@ann <!UNUSED_PARAMETER!>p<!>: Int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val bar = fun(@ann <!UNUSED_PARAMETER!>g<!>: Int) {}
|
val bar = fun(@ann <!UNUSED_PARAMETER!>g<!>: Int) {}
|
||||||
|
|
||||||
val bas = { <!DEPRECATED_LAMBDA_SYNTAX!>(@ann t: Int)<!> -> }
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public val bar: (kotlin.Int) -> kotlin.Unit
|
public val bar: (kotlin.Int) -> kotlin.Unit
|
||||||
public val bas: (kotlin.Int) -> kotlin.Unit
|
|
||||||
public fun test(/*0*/ @ann() p: kotlin.Int): kotlin.Unit
|
public fun test(/*0*/ @ann() p: kotlin.Int): kotlin.Unit
|
||||||
|
|
||||||
@kotlin.annotation.annotation() public final class ann : kotlin.Annotation {
|
@kotlin.annotation.annotation() public final class ann : kotlin.Annotation {
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ fun test4() {
|
|||||||
// should be an error on receiver, shouldn't be thrown away
|
// should be an error on receiver, shouldn't be thrown away
|
||||||
|
|
||||||
fun test5() {
|
fun test5() {
|
||||||
<!TYPE_MISMATCH!>1<!>.{ <!DEPRECATED_LAMBDA_SYNTAX!>String.(): String<!> -> this}()
|
<!TYPE_MISMATCH!>1<!>.(fun String.()=1)()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <R: Any> R?.sure() : R = this!!
|
fun <R: Any> R?.sure() : R = this!!
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
val receiver = { <!DEPRECATED_LAMBDA_SYNTAX!>Int.()<!> -> }
|
val receiver = { Int.(<!SYNTAX!><!>) <!SYNTAX!>-><!> }
|
||||||
val receiverWithParameter = { <!DEPRECATED_LAMBDA_SYNTAX!>Int.(<!CANNOT_INFER_PARAMETER_TYPE!>a<!>)<!> -> }
|
val receiverWithParameter = { Int.<!ILLEGAL_SELECTOR!>(<!DEBUG_INFO_MISSING_UNRESOLVED!>a<!>)<!> <!SYNTAX!>-><!> }
|
||||||
|
|
||||||
val receiverAndReturnType = { <!DEPRECATED_LAMBDA_SYNTAX!>Int.(): Int<!> -> 5 }
|
val receiverAndReturnType = { Int.(<!SYNTAX!><!>): Int <!SYNTAX!>-> 5<!> }
|
||||||
val receiverAndReturnTypeWithParameter = { <!DEPRECATED_LAMBDA_SYNTAX!>Int.(a: Int): Int<!> -> 5 }
|
val receiverAndReturnTypeWithParameter = { Int.<!ILLEGAL_SELECTOR!>(<!DEBUG_INFO_MISSING_UNRESOLVED!>a<!>: <!DEBUG_INFO_MISSING_UNRESOLVED!>Int<!>)<!>: Int <!SYNTAX!>-> 5<!> }
|
||||||
|
|
||||||
val returnType = { <!DEPRECATED_LAMBDA_SYNTAX!>(): Int<!> -> 5 }
|
val returnType = { (<!SYNTAX!><!>): Int <!SYNTAX!>-> 5<!> }
|
||||||
val returnTypeWithParameter = { <!DEPRECATED_LAMBDA_SYNTAX!>(b: Int): Int<!> -> 5 }
|
val returnTypeWithParameter = { (<!UNRESOLVED_REFERENCE!>b<!>: Int)<!DEPRECATED_STATIC_ASSERT!>: Int<!> <!SYNTAX!>-> 5<!> }
|
||||||
|
|
||||||
val receiverWithFunctionType = { <!DEPRECATED_LAMBDA_SYNTAX!>((Int) -> Int).()<!> -> }
|
val receiverWithFunctionType = { ((Int)<!SYNTAX!><!> <!SYNTAX!>-> Int).() -><!> }
|
||||||
|
|
||||||
val parenthesizedParameters = { <!DEPRECATED_LAMBDA_SYNTAX!>(a: Int)<!> -> }
|
val parenthesizedParameters = { (<!UNRESOLVED_REFERENCE!>a<!>: Int) <!SYNTAX!>-><!> }
|
||||||
val parenthesizedParameters2 = { <!DEPRECATED_LAMBDA_SYNTAX!>(<!CANNOT_INFER_PARAMETER_TYPE!>b<!>)<!> -> }
|
val parenthesizedParameters2 = { (<!UNRESOLVED_REFERENCE!>b<!>) <!SYNTAX!>-><!> }
|
||||||
|
|
||||||
val none = { -> }
|
val none = { -> }
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ public val newSyntax3: (???, kotlin.Int) -> kotlin.Unit
|
|||||||
public val newSyntax4: (kotlin.Int, ???) -> kotlin.Unit
|
public val newSyntax4: (kotlin.Int, ???) -> kotlin.Unit
|
||||||
public val none: () -> kotlin.Unit
|
public val none: () -> kotlin.Unit
|
||||||
public val parameterWithFunctionType: () -> ((kotlin.Int) -> kotlin.Int) -> [ERROR : No type element]
|
public val parameterWithFunctionType: () -> ((kotlin.Int) -> kotlin.Int) -> [ERROR : No type element]
|
||||||
public val parenthesizedParameters: (kotlin.Int) -> kotlin.Unit
|
public val parenthesizedParameters: () -> kotlin.Int
|
||||||
public val parenthesizedParameters2: (???) -> kotlin.Unit
|
public val parenthesizedParameters2: () -> ???
|
||||||
public val receiver: kotlin.Int.() -> kotlin.Unit
|
public val receiver: () -> ???
|
||||||
public val receiverAndReturnType: kotlin.Int.() -> kotlin.Int
|
public val receiverAndReturnType: () -> kotlin.Int
|
||||||
public val receiverAndReturnTypeWithParameter: kotlin.Int.(kotlin.Int) -> kotlin.Int
|
public val receiverAndReturnTypeWithParameter: () -> kotlin.Int
|
||||||
public val receiverWithFunctionType: ((kotlin.Int) -> kotlin.Int).() -> kotlin.Unit
|
public val receiverWithFunctionType: () -> kotlin.Int.Companion
|
||||||
public val receiverWithParameter: kotlin.Int.(???) -> kotlin.Unit
|
public val receiverWithParameter: () -> ???
|
||||||
public val returnType: () -> kotlin.Int
|
public val returnType: () -> kotlin.Int
|
||||||
public val returnTypeWithParameter: (kotlin.Int) -> kotlin.Int
|
public val returnTypeWithParameter: () -> kotlin.Int
|
||||||
|
|||||||
Vendored
+6
-5
@@ -1,3 +1,4 @@
|
|||||||
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
package a
|
package a
|
||||||
|
|
||||||
interface Super
|
interface Super
|
||||||
@@ -8,12 +9,12 @@ fun foo(f: (Trait) -> Trait) = f
|
|||||||
|
|
||||||
fun test(s: Sub) {
|
fun test(s: Sub) {
|
||||||
foo {
|
foo {
|
||||||
<!DEPRECATED_LAMBDA_SYNTAX!>(t: Super): Sub<!> -> s
|
t: Super -> s
|
||||||
}
|
}
|
||||||
foo {
|
foo {
|
||||||
<!DEPRECATED_LAMBDA_SYNTAX!>(t: Trait): Trait<!> -> s
|
t: Trait -> s
|
||||||
}
|
|
||||||
foo {
|
|
||||||
<!DEPRECATED_LAMBDA_SYNTAX!>(<!EXPECTED_PARAMETER_TYPE_MISMATCH!>t: Sub<!>): <!EXPECTED_RETURN_TYPE_MISMATCH!>Super<!><!> -> s
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foo(<!TYPE_MISMATCH!>fun(<!EXPECTED_PARAMETER_TYPE_MISMATCH!>t: Sub<!>) = s<!>)
|
||||||
|
foo(<!TYPE_MISMATCH!>fun(t): Super = s<!>)
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-8
@@ -9,26 +9,23 @@ fun test1() {
|
|||||||
""
|
""
|
||||||
}
|
}
|
||||||
foo0 {
|
foo0 {
|
||||||
<!DEPRECATED_LAMBDA_SYNTAX, EXPECTED_PARAMETERS_NUMBER_MISMATCH!>(s: String)<!> -> ""
|
<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>s: String<!>-> ""
|
||||||
}
|
}
|
||||||
foo0 {
|
foo0 {
|
||||||
<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!><!CANNOT_INFER_PARAMETER_TYPE!>x<!>, <!CANNOT_INFER_PARAMETER_TYPE!>y<!><!> -> ""
|
<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!><!CANNOT_INFER_PARAMETER_TYPE!>x<!>, <!CANNOT_INFER_PARAMETER_TYPE!>y<!><!> -> ""
|
||||||
}
|
}
|
||||||
foo0 {
|
|
||||||
<!DEPRECATED_LAMBDA_SYNTAX!>(): <!EXPECTED_RETURN_TYPE_MISMATCH!>Int<!><!> -> 42
|
|
||||||
}
|
|
||||||
|
|
||||||
foo1 {
|
foo1 {
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
foo1 {
|
foo1 {
|
||||||
<!DEPRECATED_LAMBDA_SYNTAX!>(<!EXPECTED_PARAMETER_TYPE_MISMATCH!>s: String<!>)<!> -> ""
|
<!EXPECTED_PARAMETER_TYPE_MISMATCH!>s: String<!> -> ""
|
||||||
}
|
}
|
||||||
foo1 {
|
foo1 {
|
||||||
<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>x, <!CANNOT_INFER_PARAMETER_TYPE!>y<!><!> -> ""
|
<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>x, <!CANNOT_INFER_PARAMETER_TYPE!>y<!><!> -> ""
|
||||||
}
|
}
|
||||||
foo1 {
|
foo1 {
|
||||||
<!DEPRECATED_LAMBDA_SYNTAX!><!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>()<!>: <!EXPECTED_RETURN_TYPE_MISMATCH!>Int<!><!> -> 42
|
<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!><!>-> <!CONSTANT_EXPECTED_TYPE_MISMATCH!>42<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -36,12 +33,12 @@ fun test1() {
|
|||||||
""
|
""
|
||||||
}
|
}
|
||||||
foo2 {
|
foo2 {
|
||||||
<!DEPRECATED_LAMBDA_SYNTAX, EXPECTED_PARAMETERS_NUMBER_MISMATCH!>(<!EXPECTED_PARAMETER_TYPE_MISMATCH!>s: String<!>)<!> -> ""
|
<!EXPECTED_PARAMETERS_NUMBER_MISMATCH, EXPECTED_PARAMETER_TYPE_MISMATCH!>s: String<!> -> ""
|
||||||
}
|
}
|
||||||
foo2 {
|
foo2 {
|
||||||
<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>x<!> -> ""
|
<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>x<!> -> ""
|
||||||
}
|
}
|
||||||
foo2 {
|
foo2 {
|
||||||
<!DEPRECATED_LAMBDA_SYNTAX!><!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>()<!>: <!EXPECTED_RETURN_TYPE_MISMATCH!>Int<!><!> -> 42
|
<!EXPECTED_PARAMETERS_NUMBER_MISMATCH!><!>-> <!CONSTANT_EXPECTED_TYPE_MISMATCH!>42<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Vendored
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
fun test(a: Int) {
|
fun test(a: Int) {
|
||||||
run f@{ <!DEPRECATED_LAMBDA_SYNTAX!>(): Int<!> ->
|
run<Int>f@{
|
||||||
if (a > 0) return@f <!TYPE_MISMATCH!>""<!>
|
if (a > 0) return@f <!TYPE_MISMATCH!>""<!>
|
||||||
return@f 1
|
return@f 1
|
||||||
}
|
}
|
||||||
|
|
||||||
run { <!DEPRECATED_LAMBDA_SYNTAX!>(): Int<!> -> <!TYPE_MISMATCH!>""<!> }
|
run<Int>{ <!TYPE_MISMATCH!>""<!> }
|
||||||
run { <!DEPRECATED_LAMBDA_SYNTAX!>(): Int<!> -> 1 }
|
run<Int>{ 1 }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun run<T>(f: () -> T): T { return f() }
|
fun run<T>(f: () -> T): T { return f() }
|
||||||
@@ -8,15 +8,11 @@ fun <T> Array<T>.forEach(operation: (T) -> Unit) : Unit { for (element in this)
|
|||||||
fun bar(operation: (String) -> Unit) = operation("")
|
fun bar(operation: (String) -> Unit) = operation("")
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
args.forEach { <!DEPRECATED_LAMBDA_SYNTAX!>(a : String) : Unit<!> -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found
|
args.forEach { a : String -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found
|
||||||
args.forEach { <!DEPRECATED_LAMBDA_SYNTAX!>(a) : Unit<!> -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found
|
|
||||||
args.forEach { <!DEPRECATED_LAMBDA_SYNTAX!>(a : String)<!> -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found
|
|
||||||
args.forEach { a -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found
|
args.forEach { a -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found
|
||||||
args.forEach { it.length() } // This works!
|
args.forEach { it.length() } // This works!
|
||||||
|
|
||||||
bar { <!DEPRECATED_LAMBDA_SYNTAX!>(a: String) : Unit<!> -> a.length() }
|
bar { a: String -> a.length() }
|
||||||
bar { <!DEPRECATED_LAMBDA_SYNTAX!>(a) : Unit<!> -> a.length() }
|
|
||||||
bar { <!DEPRECATED_LAMBDA_SYNTAX!>(a: String)<!> -> a.length() }
|
|
||||||
bar { a -> a.length() }
|
bar { a -> a.length() }
|
||||||
bar { it.length() }
|
bar { it.length() }
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-3
@@ -176,9 +176,15 @@ fun returnFunctionLiteralBlock(a: Any?): Function0<Int> {
|
|||||||
if (a is Int) return { <!DEBUG_INFO_SMARTCAST!>a<!> }
|
if (a is Int) return { <!DEBUG_INFO_SMARTCAST!>a<!> }
|
||||||
else return { 1 }
|
else return { 1 }
|
||||||
}
|
}
|
||||||
fun returnFunctionLiteral(a: Any?): Function0<Int> =
|
fun returnFunctionLiteral(a: Any?): Function0<Int> {
|
||||||
if (a is Int) { <!DEPRECATED_LAMBDA_SYNTAX!>(): Int<!> -> <!DEBUG_INFO_SMARTCAST!>a<!> }
|
if (a is Int) return { -> <!DEBUG_INFO_SMARTCAST!>a<!> }
|
||||||
else { <!DEPRECATED_LAMBDA_SYNTAX!>()<!> -> 1 }
|
else return { -> 1 }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun returnFunctionLiteralDoesntWork(a: Any?): Function0<Int> =
|
||||||
|
if (a is Int) <!TYPE_MISMATCH!>{ -> a }<!>
|
||||||
|
else { -> 1 }
|
||||||
|
|
||||||
|
|
||||||
fun mergeSmartCasts(a: Any?) {
|
fun mergeSmartCasts(a: Any?) {
|
||||||
if (a is String || a is Int) {
|
if (a is String || a is Int) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public fun illegalWhenBody(/*0*/ a: kotlin.Any): kotlin.Int
|
|||||||
public fun mergeSmartCasts(/*0*/ a: kotlin.Any?): kotlin.Unit
|
public fun mergeSmartCasts(/*0*/ a: kotlin.Any?): kotlin.Unit
|
||||||
public fun returnFunctionLiteral(/*0*/ a: kotlin.Any?): () -> kotlin.Int
|
public fun returnFunctionLiteral(/*0*/ a: kotlin.Any?): () -> kotlin.Int
|
||||||
public fun returnFunctionLiteralBlock(/*0*/ a: kotlin.Any?): () -> kotlin.Int
|
public fun returnFunctionLiteralBlock(/*0*/ a: kotlin.Any?): () -> kotlin.Int
|
||||||
|
public fun returnFunctionLiteralDoesntWork(/*0*/ a: kotlin.Any?): () -> kotlin.Int
|
||||||
public fun toInt(/*0*/ i: kotlin.Int?): kotlin.Int
|
public fun toInt(/*0*/ i: kotlin.Int?): kotlin.Int
|
||||||
public fun vars(/*0*/ a: kotlin.Any?): kotlin.Unit
|
public fun vars(/*0*/ a: kotlin.Any?): kotlin.Unit
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ inline fun inlineFunWithInvoke(s: (p: Int) -> Unit, ext: Int.(p: Int) -> Unit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline fun inlineFunWithInvokeClosure(s: (p: Int) -> Unit, ext: Int.(p: Int) -> Unit) {
|
inline fun inlineFunWithInvokeClosure(s: (p: Int) -> Unit, ext: Int.(p: Int) -> Unit) {
|
||||||
subInline({p: Int -> s(p)}, {<!DEPRECATED_LAMBDA_SYNTAX!>Int.(p:Int)<!> -> this.ext(p)})
|
subInline({p: Int -> s(p)}, { p -> this.ext(p)})
|
||||||
subNoInline({p: Int -> s(p)}, {<!DEPRECATED_LAMBDA_SYNTAX!>Int.(p:Int)<!> -> this.ext(p)})
|
subNoInline({p: Int -> s(p)}, { p -> this.ext(p)})
|
||||||
}
|
}
|
||||||
|
|
||||||
//No inline
|
//No inline
|
||||||
@@ -17,8 +17,8 @@ inline fun inlineFunWithInvokeNonInline(noinline s: (p: Int) -> Unit, noinline e
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline fun inlineFunWithInvokeClosureNoinline(noinline s: (p: Int) -> Unit, noinline ext: Int.(p: Int) -> Unit) {
|
inline fun inlineFunWithInvokeClosureNoinline(noinline s: (p: Int) -> Unit, noinline ext: Int.(p: Int) -> Unit) {
|
||||||
subInline({p: Int -> s(p)}, {<!DEPRECATED_LAMBDA_SYNTAX!>Int.(p:Int)<!> -> this.ext(p)})
|
subInline({p: Int -> s(p)}, { p -> this.ext(p)})
|
||||||
subNoInline({p: Int -> s(p)}, {<!DEPRECATED_LAMBDA_SYNTAX!>Int.(p:Int)<!> -> this.ext(p)})
|
subNoInline({p: Int -> s(p)}, { p -> this.ext(p)})
|
||||||
}
|
}
|
||||||
|
|
||||||
//ext function
|
//ext function
|
||||||
@@ -28,8 +28,8 @@ inline fun Function1<Int, Unit>.inlineExt(ext: Int.(p: Int) -> Unit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline fun Function1<Int, Unit>.inlineExtWithClosure(ext: Int.(p: Int) -> Unit) {
|
inline fun Function1<Int, Unit>.inlineExtWithClosure(ext: Int.(p: Int) -> Unit) {
|
||||||
subInline({p: Int -> this(p)}, {<!DEPRECATED_LAMBDA_SYNTAX!>Int.(p:Int)<!> -> this.ext(p)})
|
subInline({p: Int -> this(p)}, { p -> this.ext(p)})
|
||||||
subNoInline({p: Int -> this(p)}, {<!DEPRECATED_LAMBDA_SYNTAX!>Int.(p:Int)<!> -> this.ext(p)})
|
subNoInline({p: Int -> this(p)}, { p -> this.ext(p)})
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun subInline(s: (p: Int) -> Unit, ext: Int.(p: Int) -> Unit) {}
|
inline fun subInline(s: (p: Int) -> Unit, ext: Int.(p: Int) -> Unit) {}
|
||||||
|
|||||||
+4
-2
@@ -14,12 +14,14 @@ fun B.b() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
b@ <!UNUSED_FUNCTION_LITERAL!>{ <!DEPRECATED_LAMBDA_SYNTAX!>B.()<!> ->
|
fun <T> without(f: T.() -> Unit): Unit = (null!!).f<!UNREACHABLE_CODE!>()<!>
|
||||||
|
without<B>() b@ {
|
||||||
object : A {
|
object : A {
|
||||||
override fun foo() {
|
override fun foo() {
|
||||||
this@b.bar()
|
this@b.bar()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}<!>
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fun foo(a: Any?): Int {
|
fun foo(a: Any?): Int {
|
||||||
<!SYNTAX!>@<!>{ () : Unit ->
|
<!SYNTAX!>@<!>{ ->
|
||||||
return<!SYNTAX!>@<!>
|
return<!SYNTAX!>@<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
// KT-306 Ambiguity when different this's have same-looking functions
|
// KT-306 Ambiguity when different this's have same-looking functions
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
<!UNUSED_FUNCTION_LITERAL!>{<!DEPRECATED_LAMBDA_SYNTAX!>Foo.()<!> ->
|
(fun Foo.() {
|
||||||
bar();
|
bar()
|
||||||
{<!DEPRECATED_LAMBDA_SYNTAX!>Barr.()<!> ->
|
(fun Barr.() {
|
||||||
this.bar()
|
this.bar()
|
||||||
bar()
|
bar()
|
||||||
}
|
})
|
||||||
}<!>
|
})
|
||||||
<!UNUSED_FUNCTION_LITERAL!>{<!DEPRECATED_LAMBDA_SYNTAX!>Barr.()<!> ->
|
(fun Barr.() {
|
||||||
|
this.bar()
|
||||||
bar()
|
bar()
|
||||||
}<!>
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
class Foo {
|
class Foo {
|
||||||
|
|||||||
@@ -2,18 +2,19 @@
|
|||||||
|
|
||||||
package kt352
|
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() {
|
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() {
|
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
|
//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() }
|
val h : () -> Unit = { doSmth() }
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package
|
|||||||
package kt352 {
|
package kt352 {
|
||||||
public val f: (kotlin.Any) -> kotlin.Unit
|
public val f: (kotlin.Any) -> kotlin.Unit
|
||||||
public val g: () -> kotlin.Unit
|
public val g: () -> kotlin.Unit
|
||||||
|
public val gFunction: () -> kotlin.Unit
|
||||||
public val h: () -> kotlin.Unit
|
public val h: () -> kotlin.Unit
|
||||||
public val testIt: (kotlin.Any) -> kotlin.Unit
|
public val testIt: (kotlin.Any) -> kotlin.Unit
|
||||||
public fun doSmth(): kotlin.Int
|
public fun doSmth(): kotlin.Int
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ object A {
|
|||||||
fun foo(i: Int, f: (Int)->Int) = f(i)
|
fun foo(i: Int, f: (Int)->Int) = f(i)
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
foo(1) { <!DEPRECATED_LAMBDA_SYNTAX!>(x1: Int):Int<!> ->
|
foo(1) { x1: Int ->
|
||||||
foo(2) { <!DEPRECATED_LAMBDA_SYNTAX!>(x2: Int): Int<!> ->
|
foo(2) { x2: Int ->
|
||||||
foo(3) { <!DEPRECATED_LAMBDA_SYNTAX!>(x3: Int): Int<!> ->
|
foo(3) { x3: Int ->
|
||||||
foo(4) { <!DEPRECATED_LAMBDA_SYNTAX!>(x4: Int): Int<!> ->
|
foo(4) { x4: Int ->
|
||||||
foo(5) { <!DEPRECATED_LAMBDA_SYNTAX!>(x5: Int): Int<!> ->
|
foo(5) { x5: Int ->
|
||||||
x1 + x2 + x3 + x4 + x5 + A.iii
|
x1 + x2 + x3 + x4 + x5 + A.iii
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -17,11 +17,11 @@ fun foo(a: Any, f: (Any)->Int) = f(a)
|
|||||||
fun foo(i: Int, f: (Int)->Int) = f(i)
|
fun foo(i: Int, f: (Int)->Int) = f(i)
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
foo(1) { <!DEPRECATED_LAMBDA_SYNTAX!>(x1: Int):Int<!> ->
|
foo(1) { x1: Int ->
|
||||||
foo(2) { <!DEPRECATED_LAMBDA_SYNTAX!>(x2: Int): Int<!> ->
|
foo(2) { x2: Int ->
|
||||||
foo(3) { <!DEPRECATED_LAMBDA_SYNTAX!>(x3: Int): Int<!> ->
|
foo(3) { x3: Int ->
|
||||||
foo(4) { <!DEPRECATED_LAMBDA_SYNTAX!>(x4: Int): Int<!> ->
|
foo(4) { x4: Int ->
|
||||||
foo(5) { <!DEPRECATED_LAMBDA_SYNTAX!>(x5: Int): Int<!> ->
|
foo(5) { x5: Int ->
|
||||||
x1 + x2 + x3 + x4 + x5 + A.iii
|
x1 + x2 + x3 + x4 + x5 + A.iii
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-2
@@ -5,8 +5,6 @@ public final fun foo(/*0*/ p0: (dynamic) -> dynamic): dynamic
|
|||||||
public final fun foo(/*0*/ p0: (dynamic, dynamic) -> dynamic): dynamic
|
public final fun foo(/*0*/ p0: (dynamic, dynamic) -> dynamic): dynamic
|
||||||
public final fun foo(/*0*/ p0: (dynamic, dynamic) -> dynamic): dynamic
|
public final fun foo(/*0*/ p0: (dynamic, dynamic) -> dynamic): dynamic
|
||||||
public final fun foo(/*0*/ p0: (dynamic, dynamic) -> dynamic): dynamic
|
public final fun foo(/*0*/ p0: (dynamic, dynamic) -> dynamic): dynamic
|
||||||
public final fun foo(/*0*/ p0: (dynamic, dynamic) -> dynamic): dynamic
|
|
||||||
public final fun foo(/*0*/ p0: dynamic.(dynamic, dynamic) -> dynamic): dynamic
|
|
||||||
public final fun foo(/*0*/ p0: () -> dynamic): dynamic
|
public final fun foo(/*0*/ p0: () -> dynamic): dynamic
|
||||||
public final fun foo(/*0*/ p0: (dynamic) -> dynamic): dynamic
|
public final fun foo(/*0*/ p0: (dynamic) -> dynamic): dynamic
|
||||||
public final fun foo(/*0*/ p0: dynamic): dynamic
|
public final fun foo(/*0*/ p0: dynamic): dynamic
|
||||||
|
|||||||
+4
-8
@@ -7,17 +7,13 @@ fun test(d: dynamic) {
|
|||||||
|
|
||||||
d.foo { x -> }
|
d.foo { x -> }
|
||||||
|
|
||||||
d.foo { <!DEPRECATED_LAMBDA_SYNTAX!>(x: Int)<!> -> "" }
|
d.foo { x: Int -> "" }
|
||||||
|
|
||||||
d.foo { x, y -> "" }
|
d.foo { x, y -> "" }
|
||||||
|
|
||||||
d.foo { <!DEPRECATED_LAMBDA_SYNTAX!>(x: String, y: Int)<!> -> "" }
|
d.foo { x: String, y: Int -> "" }
|
||||||
|
|
||||||
d.foo { <!DEPRECATED_LAMBDA_SYNTAX!>(x, y: Int)<!> -> "" }
|
d.foo { x, y: Int -> "" }
|
||||||
|
|
||||||
d.foo { <!DEPRECATED_LAMBDA_SYNTAX!>(x: String, y: Int): Int<!> -> <!TYPE_MISMATCH!>""<!> }
|
|
||||||
|
|
||||||
d.foo { <!DEPRECATED_LAMBDA_SYNTAX!>String.(x: String, y: Int): Int<!> -> length() }
|
|
||||||
|
|
||||||
d.foo({})
|
d.foo({})
|
||||||
|
|
||||||
@@ -29,7 +25,7 @@ fun test(d: dynamic) {
|
|||||||
|
|
||||||
d.foo(label@ ({ x, y -> }))
|
d.foo(label@ ({ x, y -> }))
|
||||||
|
|
||||||
d.foo((label@ ({ <!DEPRECATED_LAMBDA_SYNTAX!>(x, y: Int)<!> -> })))
|
d.foo((label@ ({ x, y: Int -> })))
|
||||||
|
|
||||||
d.foo(({ x -> }))
|
d.foo(({ x -> }))
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ package qualified_this {
|
|||||||
~xx~val Int.xx get() = `xx`this : Int
|
~xx~val Int.xx get() = `xx`this : Int
|
||||||
~xx()~fun Int.xx() {
|
~xx()~fun Int.xx() {
|
||||||
`xx()`this : Int
|
`xx()`this : Int
|
||||||
val a = {Int.() -> `xx()`this`xx()`@xx + this}
|
val a = (fun Int.() = `xx()`this`xx()`@xx + this)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
fun <T> foo(f: (T) -> String) {}
|
fun <T> foo(f: (T) -> String) {}
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
<caret>foo { (x: Int) -> "$x"}
|
<caret>foo { x: Int -> "$x"}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
fun <T> foo(f: (T) -> String) {}
|
fun <T> foo(f: (T) -> String) {}
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
<caret>foo { (x: Int) -> "$x"}
|
<caret>foo { x: Int -> "$x"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -16,4 +16,4 @@ Extension receiver = NO_RECEIVER
|
|||||||
|
|
||||||
Value arguments mapping:
|
Value arguments mapping:
|
||||||
|
|
||||||
SUCCESS f : (Int) -> String = { (x: Int) -> "$x"}
|
SUCCESS f : (Int) -> String = { x: Int -> "$x"}
|
||||||
|
|||||||
@@ -366,30 +366,30 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFunctionLiterals() throws Exception {
|
public void testFunctionLiterals() throws Exception {
|
||||||
assertType("{() -> }", "() -> Unit");
|
assertType("{ -> }", "() -> Unit");
|
||||||
assertType("{() : Int -> }", "() -> Int");
|
assertType("fun(): Int = 1", "() -> Int");
|
||||||
assertType("{() -> 1}", "() -> Int");
|
assertType("{ 1}", "() -> Int");
|
||||||
|
|
||||||
assertType("{(a : Int) -> 1}", "(a : Int) -> Int");
|
assertType("{ a : Int -> 1}", "(a : Int) -> Int");
|
||||||
assertType("{(a : Int, b : String) -> 1}", "(a : Int, b : String) -> Int");
|
assertType("{ a : Int, b : String -> 1}", "(a : Int, b : String) -> Int");
|
||||||
|
|
||||||
assertType("{(a : Int) -> 1}", "(Int) -> Int");
|
assertType("{ a : Int -> 1}", "(Int) -> Int");
|
||||||
assertType("{(a : Int, b : String) -> 1}", "(Int, String) -> Int");
|
assertType("{ a : Int, b : String -> 1}", "(Int, String) -> Int");
|
||||||
|
|
||||||
assertType("{Any.() -> 1}", "Any.() -> Int");
|
assertType("fun Any.(): Int = 1", "Any.() -> Int");
|
||||||
|
|
||||||
assertType("{Any.(a : Int) -> 1}", "Any.(a : Int) -> Int");
|
assertType("fun Any.(a : Int) = 1", "Any.(a : Int) -> Int");
|
||||||
assertType("{Any.(a : Int, b : String) -> 1}", "Any.(a : Int, b : String) -> Int");
|
assertType("fun Any.(a : Int, b : String) = 1", "Any.(a : Int, b : String) -> Int");
|
||||||
|
|
||||||
assertType("{Any.(a : Int) -> 1}", "Any.(Int) -> Int");
|
assertType("fun Any.(a : Int) = 1", "Any.(Int) -> Int");
|
||||||
assertType("{Any.(a : Int, b : String) -> 1}", "Any.(Int, String) -> Int");
|
assertType("fun Any.(a : Int, b : String) = 1", "Any.(Int, String) -> Int");
|
||||||
|
|
||||||
assertType("{Any.(a : Int, b : String) -> b}", "Any.(Int, String) -> String");
|
assertType("fun Any.(a : Int, b : String) = b", "Any.(Int, String) -> String");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testBlocks() throws Exception {
|
public void testBlocks() throws Exception {
|
||||||
assertType("if (1) {val a = 1; a} else {null}", "Int?");
|
assertType("if (1) {val a = 1; a} else {null}", "Int?");
|
||||||
assertType("if (1) {() -> val a = 1; a} else {() -> null}", "Function0<Int?>");
|
assertType("if (1) { -> val a = 1; a} else { -> null}", "Function0<Int?>");
|
||||||
assertType("if (1) (fun (): Boolean { val a = 1; a; var b : Boolean; return b }) else null", "Function0<Boolean>?");
|
assertType("if (1) (fun (): Boolean { val a = 1; a; var b : Boolean; return b }) else null", "Function0<Boolean>?");
|
||||||
assertType("if (1) (fun (): Int { val a = 1; a; var b = a; return b }) else null", "Function0<Int>?");
|
assertType("if (1) (fun (): Int { val a = 1; a; var b = a; return b }) else null", "Function0<Int>?");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class TestClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun testFun() {
|
fun testFun() {
|
||||||
val lambda = {() -> TestClass() }
|
val lambda = { -> TestClass() }
|
||||||
lambda().<caret>
|
lambda().<caret>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
takeHandler1 {
|
takeHandler1 {
|
||||||
takeHandler2({ (): String -> ret<caret> })
|
takeHandler2({ -> ret<caret> })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
takeHandler1 {
|
takeHandler1 {
|
||||||
takeHandler2({ (): String -> return@takeHandler2 <caret> })
|
takeHandler2({ -> return@takeHandler2 <caret> })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ fun foo(a: Int, b: String) {}
|
|||||||
fun f(p: (Int, String) -> Unit){}
|
fun f(p: (Int, String) -> Unit){}
|
||||||
|
|
||||||
fun bar() {
|
fun bar() {
|
||||||
f { (a, b) -> foo(<caret>) }
|
f { a, b -> foo(<caret>) }
|
||||||
}
|
}
|
||||||
|
|
||||||
// EXIST: "a, b"
|
// EXIST: "a, b"
|
||||||
|
|||||||
+1
-1
@@ -7,5 +7,5 @@ fun <T, R> foo(a: A<T, R>) = a
|
|||||||
fun test() {
|
fun test() {
|
||||||
foo { it }
|
foo { it }
|
||||||
foo { x -> x}
|
foo { x -> x}
|
||||||
foo { (x: Int) -> x}
|
foo { x: Int -> x}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
val (i :Int, s :String) = bar()
|
val (i :Int, s :String) = bar()
|
||||||
val h = {() :Unit -> bar() }
|
val h = { -> bar() }
|
||||||
for (i :Int in collection) {
|
for (i :Int in collection) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
val (i: Int, s: String) = bar()
|
val (i: Int, s: String) = bar()
|
||||||
val h = {(): Unit -> bar() }
|
val h = { -> bar() }
|
||||||
for (i: Int in collection) {
|
for (i: Int in collection) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
val (i:Int,s:String) = bar()
|
val (i:Int,s:String) = bar()
|
||||||
val h = {():Unit -> bar()}
|
val h = { -> bar()}
|
||||||
for (i:Int in collection) {
|
for (i:Int in collection) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -16,19 +16,19 @@ fun test3(): Int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun test4(): Int {
|
fun test4(): Int {
|
||||||
return synchronized(this) {(): Int ->
|
return synchronized(this) { ->
|
||||||
return@synchronized 12
|
return@synchronized 12
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test5(): Int {
|
fun test5(): Int {
|
||||||
return synchronized(this) {(): Int ->
|
return synchronized(this) { ->
|
||||||
return@synchronized 12
|
return@synchronized 12
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test6(): Int {
|
fun test6(): Int {
|
||||||
return synchronized(this) {(): Int ->
|
return synchronized(this) { ->
|
||||||
return
|
return
|
||||||
|
|
||||||
@synchronized
|
@synchronized
|
||||||
|
|||||||
+3
-3
@@ -16,19 +16,19 @@ fun test3(): Int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun test4(): Int {
|
fun test4(): Int {
|
||||||
return synchronized(this) {(): Int ->
|
return synchronized(this) { ->
|
||||||
return@synchronized 12
|
return@synchronized 12
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test5(): Int {
|
fun test5(): Int {
|
||||||
return synchronized(this) {(): Int ->
|
return synchronized(this) { ->
|
||||||
return @synchronized 12
|
return @synchronized 12
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test6(): Int {
|
fun test6(): Int {
|
||||||
return synchronized(this) {(): Int ->
|
return synchronized(this) { ->
|
||||||
return
|
return
|
||||||
|
|
||||||
@synchronized
|
@synchronized
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ fun test(some: (Int) -> Int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun foo() = test() {it}
|
fun foo() = test() {it}
|
||||||
val function = test {(a: Int) -> a}
|
val function = test {a: Int -> a}
|
||||||
val function1 = test {a: Int -> a}
|
val function1 = test {a: Int -> a}
|
||||||
val function2 = test { }
|
val function2 = test { }
|
||||||
val function3 = test {}
|
val function3 = test {}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ fun test(some: (Int) -> Int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun foo() = test() { it }
|
fun foo() = test() { it }
|
||||||
val function = test {(a: Int) -> a }
|
val function = test { a: Int -> a }
|
||||||
val function1 = test { a: Int -> a }
|
val function1 = test { a: Int -> a }
|
||||||
val function2 = test { }
|
val function2 = test { }
|
||||||
val function3 = test {}
|
val function3 = test {}
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ fun test(some: (Int) -> Int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun foo() = test() { it }
|
fun foo() = test() { it }
|
||||||
val function = test { (a: Int) -> a }
|
val function = test { a: Int -> a }
|
||||||
val function1 = test {a : Int -> a}
|
val function1 = test {a : Int -> a}
|
||||||
val function2 = test { }
|
val function2 = test { }
|
||||||
val function3 = test {}
|
val function3 = test {}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
fun <T> test(a: Int) = {(a: Int) -> a }
|
fun <T> test(a: Int) = { a: Int -> a }
|
||||||
class Test<T>
|
class Test<T>
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
fun < T > test( a: Int ) = {( a: Int ) -> a }
|
fun < T > test( a: Int ) = { a: Int -> a }
|
||||||
class Test< T >
|
class Test< T >
|
||||||
|
|
||||||
fun foo( ) {
|
fun foo( ) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// IS_APPLICABLE: false
|
// IS_APPLICABLE: false
|
||||||
fun foo(): Any {
|
fun foo(): Any {
|
||||||
return { (x: String<caret>) -> 42 }
|
return { x: String<caret> -> 42 }
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
fun f() {
|
fun f() {
|
||||||
val f = { (<caret>x: Int) -> x + x }
|
val f = { <caret>x: Int -> x + x }
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun f() {
|
fun f() {
|
||||||
val f = { (<caret>y: Int) -> y + y }
|
val f = { <caret>y: Int -> y + y }
|
||||||
}
|
}
|
||||||
+1
-1
@@ -5,6 +5,6 @@ class C {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
val lambda = {() -> /* STATEMENT DELETED: x() */; C() }
|
val lambda = { -> /* STATEMENT DELETED: x() */; C() }
|
||||||
lambda().<caret>f()
|
lambda().<caret>f()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3,6 +3,6 @@ class C {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
val lambda = {() -> x(); C() }
|
val lambda = { -> x(); C() }
|
||||||
lambda().<caret>f()
|
lambda().<caret>f()
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+4
-10
@@ -1,29 +1,23 @@
|
|||||||
fun foo(f: (Int) -> Unit) {
|
fun foo(f: (Int) -> Unit) {
|
||||||
{ (m: Int, n: Int, s: String) ->
|
{ m: Int, n: Int, s: String ->
|
||||||
val a = n + m
|
val a = n + m
|
||||||
println(s)
|
println(s)
|
||||||
f(a)
|
f(a)
|
||||||
}
|
}
|
||||||
|
|
||||||
{ (n: Int, s: String) ->
|
{ n: Int, s: String ->
|
||||||
val a = n + 1
|
val a = n + 1
|
||||||
println(s)
|
println(s)
|
||||||
f(a)
|
f(a)
|
||||||
}
|
}
|
||||||
|
|
||||||
<selection>{ Int.(n: Int, s: String) ->
|
val q: Int.(Int, String) -> Unit = <selection>{ n: Int, s: String ->
|
||||||
val a = n + this
|
val a = n + this
|
||||||
println(s)
|
println(s)
|
||||||
f(a)
|
f(a)
|
||||||
}</selection>
|
}</selection>
|
||||||
|
|
||||||
{ Int.(m: Int, r: String) ->
|
val g: Int.(Int, String) -> Unit = { a, b ->
|
||||||
val b = m + this
|
|
||||||
println(r)
|
|
||||||
f(b)
|
|
||||||
}
|
|
||||||
|
|
||||||
val g: Int.(Int, String) -> Unit = { (a, b) ->
|
|
||||||
val m = a + this
|
val m = a + this
|
||||||
println(b)
|
println(b)
|
||||||
f(m)
|
f(m)
|
||||||
|
|||||||
+2
-8
@@ -1,16 +1,10 @@
|
|||||||
{ Int.(n: Int, s: String) ->
|
{ n: Int, s: String ->
|
||||||
val a = n + this
|
val a = n + this
|
||||||
println(s)
|
println(s)
|
||||||
f(a)
|
f(a)
|
||||||
}
|
}
|
||||||
|
|
||||||
{ Int.(m: Int, r: String) ->
|
{ a, b ->
|
||||||
val b = m + this
|
|
||||||
println(r)
|
|
||||||
f(b)
|
|
||||||
}
|
|
||||||
|
|
||||||
{ (a, b) ->
|
|
||||||
val m = a + this
|
val m = a + this
|
||||||
println(b)
|
println(b)
|
||||||
f(m)
|
f(m)
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ fun box():String {
|
|||||||
r = run(a, "!!", A::locExtBar)
|
r = run(a, "!!", A::locExtBar)
|
||||||
if (r != "sA:locExtBar:!!") return r
|
if (r != "sA:locExtBar:!!") return r
|
||||||
|
|
||||||
r = run(a, "!!") {(a: A, other: String): String -> a.s + ":literal:" + other }
|
r = run(a, "!!") { a: A, other: String -> a.s + ":literal:" + other }
|
||||||
if (r != "sA:literal:!!") return r
|
if (r != "sA:literal:!!") return r
|
||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ fun Int.sum0(other: Int): Int = this + other
|
|||||||
fun box(): String {
|
fun box(): String {
|
||||||
fun Int.sum1(other: Int): Int = this + other
|
fun Int.sum1(other: Int): Int = this + other
|
||||||
|
|
||||||
val sum2 = {Int.(other : Int) : Int -> this + other}
|
val sum2 = fun Int.(other: Int): Int = this + other
|
||||||
|
|
||||||
var x = 10
|
var x = 10
|
||||||
x = x.sum0(5)
|
x = x.sum0(5)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fun box(): String {
|
fun box(): String {
|
||||||
return apply("OK", {(arg: String) -> arg })
|
return apply("OK", { arg: String -> arg })
|
||||||
}
|
}
|
||||||
|
|
||||||
fun apply(arg: String, f: (p: String) -> String): String {
|
fun apply(arg: String, f: (p: String) -> String): String {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fun box(): String {
|
fun box(): String {
|
||||||
return if (apply(5) {(arg: Int) -> arg + 13 } == 18) "OK" else "fail"
|
return if (apply(5) { arg: Int -> arg + 13 } == 18) "OK" else "fail"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun apply(arg: Int, f: (p: Int) -> Int): Int {
|
fun apply(arg: Int, f: (p: Int) -> Int): Int {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class Point(val x: Int, val y: Int)
|
class Point(val x: Int, val y: Int)
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val answer = apply(Point(3, 5), { Point.(scalar: Int): Point ->
|
val answer = apply(Point(3, 5), { scalar: Int ->
|
||||||
Point(x * scalar, y * scalar)
|
Point(x * scalar, y * scalar)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val a = 23.{ Int.(a: Int) -> a * a + this }(3)
|
val a = 23.(fun Int.(a: Int): Int = a * a + this)(3)
|
||||||
if (a != 32) return "a != 32, a = $a";
|
if (a != 32) return "a != 32, a = $a";
|
||||||
|
|
||||||
return "OK";
|
return "OK";
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ fun box(): Any? {
|
|||||||
if ( (10.foo1())() != "23910") return "foo1 fail"
|
if ( (10.foo1())() != "23910") return "foo1 fail"
|
||||||
if ( (10.foo2())(1) != 11 ) return "foo2 fail"
|
if ( (10.foo2())(1) != 11 ) return "foo2 fail"
|
||||||
|
|
||||||
if (1.{ Int.() -> this + 1 }() != 2) return "test 3 failed";
|
if (1.(fun Int.(): Int = this + 1)() != 2) return "test 3 failed";
|
||||||
if ( { 1 }() != 1) return "test 4 failed";
|
if ( { 1 }() != 1) return "test 4 failed";
|
||||||
if ( { x: Int -> x }(1) != 1) return "test 5 failed";
|
if ( { x: Int -> x }(1) != 1) return "test 5 failed";
|
||||||
if ( 1.{ Int.(x: Int) -> x + this }(1) != 2) return "test 6 failed";
|
if ( 1.(fun Int.(x: Int): Int = x + this)(1) != 2) return "test 6 failed";
|
||||||
val tmp = 1.({ Int.() -> this })()
|
val tmp = 1.(fun Int.(): Int = this)()
|
||||||
if (+tmp != 1) return "test 7 failed, res: $tmp ${tmp is Int}";
|
if (+tmp != 1) return "test 7 failed, res: $tmp ${tmp is Int}";
|
||||||
if ( (fooT1<String>("mama"))() != "mama") return "test 8 failed";
|
if ( (fooT1<String>("mama"))() != "mama") return "test 8 failed";
|
||||||
if ( (fooT2<String>("mama"))("papa") != "mamapapa") return "test 9 failed";
|
if ( (fooT2<String>("mama"))("papa") != "mamapapa") return "test 9 failed";
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package foo
|
|||||||
|
|
||||||
fun Int.foo(a: Int) = this + a
|
fun Int.foo(a: Int) = this + a
|
||||||
|
|
||||||
val bar = { Int.(a: Int) -> this * a }
|
val bar = fun Int.(a: Int): Int = this * a
|
||||||
|
|
||||||
fun test(op: Int.(Int) -> Int) = 3 op 20
|
fun test(op: Int.(Int) -> Int) = 3 op 20
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val op = { Int.(a: Int) -> this / a }
|
val op = fun Int.(a: Int): Int = this / a
|
||||||
|
|
||||||
assertEquals(41, 34 foo 7)
|
assertEquals(41, 34 foo 7)
|
||||||
assertEquals(28, 4 bar 7)
|
assertEquals(28, 4 bar 7)
|
||||||
|
|||||||
@@ -124,8 +124,8 @@ public val A.boo: Int
|
|||||||
get() = 1
|
get() = 1
|
||||||
public fun A.boo(): Int = 2
|
public fun A.boo(): Int = 2
|
||||||
|
|
||||||
val public_ext_f = { A.(): Int -> this.foo() + this.foo }
|
val public_ext_f: A.() -> Int = { -> this.foo() + this.foo }
|
||||||
val public_ext_b = { A.(): Int -> this.boo() + this.boo }
|
val public_ext_b: A.() -> Int = { -> this.boo() + this.boo }
|
||||||
|
|
||||||
interface TestPublicInTrait {
|
interface TestPublicInTrait {
|
||||||
public fun foo(): Int = 2
|
public fun foo(): Int = 2
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
package foo
|
package foo
|
||||||
|
|
||||||
fun box(): Boolean {
|
fun box(): Boolean {
|
||||||
val v1 = 1.{ Int.(x: Int) -> this + x }(2)
|
val v1 = 1.(fun Int.(x: Int) = this + x)(2)
|
||||||
|
|
||||||
val f = { Int.(x: Int) -> this + x }
|
val f = fun Int.(x: Int) = this + x
|
||||||
val v2 = 1.(f)(2)
|
val v2 = 1.(f)(2)
|
||||||
|
|
||||||
return v1 == 3 && v2 == 3
|
return v1 == 3 && v2 == 3
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ class M() {
|
|||||||
|
|
||||||
fun eval() {
|
fun eval() {
|
||||||
var d = {
|
var d = {
|
||||||
var c = { Int.() -> this + 3 }
|
var c = fun Int.(): Int = this + 3
|
||||||
m += 3.c()
|
m += 3.c()
|
||||||
}
|
}
|
||||||
d();
|
d();
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ fun test1(): Int {
|
|||||||
|
|
||||||
fun test2(): Int {
|
fun test2(): Int {
|
||||||
val inlineX = Inline(9)
|
val inlineX = Inline(9)
|
||||||
return inlineX.calcExt2({Int.() -> this}, 25)
|
return inlineX.calcExt2({ -> this}, 25)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test3(): Int {
|
fun test3(): Int {
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ package foo
|
|||||||
|
|
||||||
fun test1(): Int {
|
fun test1(): Int {
|
||||||
val inlineX = Inline()
|
val inlineX = Inline()
|
||||||
return inlineX.foo({ z: Int -> "" + z}, 25, { String.() -> this.length() })
|
return inlineX.foo({ z: Int -> "" + z}, 25, { -> this.length() })
|
||||||
}
|
}
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package foo
|
|||||||
|
|
||||||
class A(val v: Int)
|
class A(val v: Int)
|
||||||
|
|
||||||
val times = { A.(a: Int) -> this.v * a }
|
val times: A.(Int) -> Int = { a -> this.v * a }
|
||||||
|
|
||||||
fun test(div: A.(Int) -> Int) = A(20) / 4
|
fun test(div: A.(Int) -> Int) = A(20) / 4
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val compareTo = { A.(a: A) -> this.v - a.v }
|
val compareTo: A.(A) -> Int = { a: A -> this.v - a.v }
|
||||||
|
|
||||||
assertEquals(28, A(4) * 7)
|
assertEquals(28, A(4) * 7)
|
||||||
assertEquals(5, test { this.v / it })
|
assertEquals(5, test { this.v / it })
|
||||||
|
|||||||
Reference in New Issue
Block a user