[IR] update testdata: removed extra indentation for function expressions

This commit is contained in:
Zalim Bashorov
2020-11-06 03:26:51 +03:00
committed by teamcityserver
parent cf5ba82453
commit ab8188b032
76 changed files with 168 additions and 168 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ class TestInitValInLambdaCalledOnce {
get get
init { init {
1.run<Int, Unit>(block = local fun Int.<anonymous>() { 1.run<Int, Unit>(block = local fun Int.<anonymous>() {
#x = 0 #x = 0
} }
) )
@@ -1,5 +1,5 @@
data class A { data class A {
constructor(runA: @ExtensionFunctionType Function2<A, String, Unit> = local fun A.<anonymous>(it: String) { constructor(runA: @ExtensionFunctionType Function2<A, String, Unit> = local fun A.<anonymous>(it: String) {
return Unit return Unit
} }
) /* primary */ { ) /* primary */ {
@@ -4,7 +4,7 @@ annotation class Ann : Annotation {
} }
val test1: Int /* by */ val test1: Int /* by */
field = lazy<Int>(initializer = local fun <anonymous>(): Int { field = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42 return 42
} }
) )
@@ -9,7 +9,7 @@ annotation class A : Annotation {
fun foo(m: Map<String, Int>) { fun foo(m: Map<String, Int>) {
@A(x = "foo/test") @A(x = "foo/test")
val test: Int val test: Int
val test$delegate: Lazy<Int> = lazy<Int>(initializer = local fun <anonymous>(): Int { val test$delegate: Lazy<Int> = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42 return 42
} }
) )
@@ -36,7 +36,7 @@ class C {
get get
val test7: Int /* by */ val test7: Int /* by */
field = lazy<Int>(initializer = local fun <anonymous>(): Int { field = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42 return 42
} }
) )
@@ -1,5 +1,5 @@
val test1: Int /* by */ val test1: Int /* by */
field = lazy<Int>(initializer = local fun <anonymous>(): Int { field = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42 return 42
} }
) )
@@ -19,7 +19,7 @@ class C {
get get
val test2: Int /* by */ val test2: Int /* by */
field = lazy<Int>(initializer = local fun <anonymous>(): Int { field = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42 return 42
} }
) )
@@ -1,6 +1,6 @@
fun test1() { fun test1() {
val x: Int val x: Int
val x$delegate: Lazy<Int> = lazy<Int>(initializer = local fun <anonymous>(): Int { val x$delegate: Lazy<Int> = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42 return 42
} }
) )
@@ -29,7 +29,7 @@ val test6: Int
get get
val test7: Int /* by */ val test7: Int /* by */
field = lazy<Int>(initializer = local fun <anonymous>(): Int { field = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42 return 42
} }
) )
@@ -1,26 +1,26 @@
val test1: Function1<String, String> val test1: Function1<String, String>
field = local fun <anonymous>(it: String): String { field = local fun <anonymous>(it: String): String {
return it return it
} }
get get
val test2: @ExtensionFunctionType Function2<Any, Any, Any> val test2: @ExtensionFunctionType Function2<Any, Any, Any>
field = local fun Any.<anonymous>(it: Any): Int { field = local fun Any.<anonymous>(it: Any): Int {
return it.hashCode() return it.hashCode()
} }
get get
val test3: Function2<Int, Int, Unit> val test3: Function2<Int, Int, Unit>
field = local fun <anonymous>(i: Int, j: Int) { field = local fun <anonymous>(i: Int, j: Int) {
return Unit return Unit
} }
get get
val test4: Function2<Int, Int, Unit> val test4: Function2<Int, Int, Unit>
field = local fun <no name provided>(i: Int, j: Int) { field = local fun <no name provided>(i: Int, j: Int) {
} }
get get
@@ -17,10 +17,10 @@ fun box(): String {
result = "OK" result = "OK"
} }
return f(, f2 = local fun <anonymous>(): String { return f(, f2 = local fun <anonymous>(): String {
return "O" return "O"
} }
).plus(other = f(f1 = local fun <anonymous>(): String { ).plus(other = f(f1 = local fun <anonymous>(): String {
return "K" return "K"
} }
)) ))
@@ -12,7 +12,7 @@ fun test2() {
fun test3() { fun test3() {
while (true) { // BLOCK while (true) { // BLOCK
val lambda: Function0<Nothing> = local fun <anonymous>(): Nothing { val lambda: Function0<Nothing> = local fun <anonymous>(): Nothing {
error("") /* ERROR EXPRESSION */ error("") /* ERROR EXPRESSION */
error("") /* ERROR EXPRESSION */ error("") /* ERROR EXPRESSION */
} }
@@ -1,5 +1,5 @@
fun testBreakFor() { fun testBreakFor() {
val xs: IntArray = IntArray(size = 10, init = local fun <anonymous>(i: Int): Int { val xs: IntArray = IntArray(size = 10, init = local fun <anonymous>(i: Int): Int {
return i return i
} }
) )
@@ -38,7 +38,7 @@ fun testBreakDoWhile() {
} }
fun testContinueFor() { fun testContinueFor() {
val xs: IntArray = IntArray(size = 10, init = local fun <anonymous>(i: Int): Int { val xs: IntArray = IntArray(size = 10, init = local fun <anonymous>(i: Int): Int {
return i return i
} }
) )
@@ -20,21 +20,21 @@ fun C.extensionBoth(i: Int, s: String = "", vararg t: String) {
} }
fun testExtensionVararg() { fun testExtensionVararg() {
use(f = local fun extensionVararg(p0: C, p1: Int) { use(f = local fun extensionVararg(p0: C, p1: Int) {
p0.extensionVararg(i = p1) p0.extensionVararg(i = p1)
} }
) )
} }
fun testExtensionDefault() { fun testExtensionDefault() {
use(f = local fun extensionDefault(p0: C, p1: Int) { use(f = local fun extensionDefault(p0: C, p1: Int) {
p0.extensionDefault(i = p1) p0.extensionDefault(i = p1)
} }
) )
} }
fun testExtensionBoth() { fun testExtensionBoth() {
use(f = local fun extensionBoth(p0: C, p1: Int) { use(f = local fun extensionBoth(p0: C, p1: Int) {
p0.extensionBoth(i = p1) p0.extensionBoth(i = p1)
} }
) )
@@ -17,28 +17,28 @@ fun fnv(vararg xs: Int): Int {
} }
fun test0() { fun test0() {
return useUnit0(fn = local fun fn0() { return useUnit0(fn = local fun fn0() {
fn0() /*~> Unit */ fn0() /*~> Unit */
} }
) )
} }
fun test1() { fun test1() {
return useUnit1(fn = local fun fn1(p0: Int) { return useUnit1(fn = local fun fn1(p0: Int) {
fn1(x = p0) /*~> Unit */ fn1(x = p0) /*~> Unit */
} }
) )
} }
fun testV0() { fun testV0() {
return useUnit0(fn = local fun fnv() { return useUnit0(fn = local fun fnv() {
fnv() /*~> Unit */ fnv() /*~> Unit */
} }
) )
} }
fun testV1() { fun testV1() {
return useUnit1(fn = local fun fnv(p0: Int) { return useUnit1(fn = local fun fnv(p0: Int) {
fnv(xs = [p0]) /*~> Unit */ fnv(xs = [p0]) /*~> Unit */
} }
) )
@@ -46,7 +46,7 @@ fun withVararg(vararg xs: Int): Int {
fun test1() { fun test1() {
{ // BLOCK { // BLOCK
val tmp0_array: A = A val tmp0_array: A = A
val tmp2_sam: IFoo = local fun withVararg(p0: Int) { val tmp2_sam: IFoo = local fun withVararg(p0: Int) {
withVararg(xs = [p0]) /*~> Unit */ withVararg(xs = [p0]) /*~> Unit */
} }
/*-> IFoo */ /*-> IFoo */
@@ -57,7 +57,7 @@ fun test1() {
fun test2() { fun test2() {
{ // BLOCK { // BLOCK
val tmp0_array: B = B val tmp0_array: B = B
val tmp2_sam: IFoo2 = local fun withVararg(p0: Int) { val tmp2_sam: IFoo2 = local fun withVararg(p0: Int) {
withVararg(xs = [p0]) /*~> Unit */ withVararg(xs = [p0]) /*~> Unit */
} }
/*-> IFoo2 */ /*-> IFoo2 */
@@ -30,7 +30,7 @@ class Outer {
} }
fun testConstructor(): Any { fun testConstructor(): Any {
return use(fn = local fun <init>(p0: Int): C { return use(fn = local fun <init>(p0: Int): C {
return C(xs = [p0]) return C(xs = [p0])
} }
) )
@@ -20,14 +20,14 @@ fun use(fn: Function0<Any>): Any {
} }
fun testFn(): Any { fun testFn(): Any {
return use(fn = local fun foo(): String { return use(fn = local fun foo(): String {
return foo() return foo()
} }
) )
} }
fun testCtor(): Any { fun testCtor(): Any {
return use(fn = local fun <init>(): C { return use(fn = local fun <init>(): C {
return C() return C()
} }
) )
@@ -36,7 +36,7 @@ class C {
} }
fun testLambda() { fun testLambda() {
useSuspend(fn = local suspend fun <anonymous>() { useSuspend(fn = local suspend fun <anonymous>() {
foo1() foo1()
} }
) )
@@ -47,42 +47,42 @@ fun testNoCoversion() {
} }
fun testSuspendPlain() { fun testSuspendPlain() {
useSuspend(fn = local suspend fun foo1() { useSuspend(fn = local suspend fun foo1() {
foo1() foo1()
} }
) )
} }
fun testSuspendWithArgs() { fun testSuspendWithArgs() {
useSuspendInt(fn = local suspend fun fooInt(p0: Int) { useSuspendInt(fn = local suspend fun fooInt(p0: Int) {
fooInt(x = p0) fooInt(x = p0)
} }
) )
} }
fun testWithVararg() { fun testWithVararg() {
useSuspend(fn = local suspend fun foo2() { useSuspend(fn = local suspend fun foo2() {
foo2() foo2()
} }
) )
} }
fun testWithVarargMapped() { fun testWithVarargMapped() {
useSuspendInt(fn = local suspend fun foo2(p0: Int) { useSuspendInt(fn = local suspend fun foo2(p0: Int) {
foo2(xs = [p0]) foo2(xs = [p0])
} }
) )
} }
fun testWithCoercionToUnit() { fun testWithCoercionToUnit() {
useSuspend(fn = local suspend fun foo3() { useSuspend(fn = local suspend fun foo3() {
foo3() /*~> Unit */ foo3() /*~> Unit */
} }
) )
} }
fun testWithDefaults() { fun testWithDefaults() {
useSuspend(fn = local suspend fun foo4() { useSuspend(fn = local suspend fun foo4() {
foo4() foo4()
} }
) )
@@ -31,7 +31,7 @@ object Obj : A {
} }
fun testUnbound() { fun testUnbound() {
use1(fn = local fun foo(p0: A, p1: Int) { use1(fn = local fun foo(p0: A, p1: Int) {
p0.foo(xs = [p1]) /*~> Unit */ p0.foo(xs = [p1]) /*~> Unit */
} }
) )
@@ -11,7 +11,7 @@ fun withVararg(vararg xs: Int): Int {
} }
fun test() { fun test() {
useFoo(foo = local fun withVararg(p0: Int) { useFoo(foo = local fun withVararg(p0: Int) {
withVararg(xs = [p0]) /*~> Unit */ withVararg(xs = [p0]) /*~> Unit */
} }
/*-> IFoo */) /*-> IFoo */)
@@ -35,21 +35,21 @@ object Host {
} }
fun testDefault(): String { fun testDefault(): String {
return use(fn = local fun fnWithDefault(p0: Int): String { return use(fn = local fun fnWithDefault(p0: Int): String {
return fnWithDefault(a = p0) return fnWithDefault(a = p0)
} }
) )
} }
fun testVararg(): String { fun testVararg(): String {
return use(fn = local fun fnWithVarargs(p0: Int): String { return use(fn = local fun fnWithVarargs(p0: Int): String {
return fnWithVarargs(xs = [p0]) return fnWithVarargs(xs = [p0])
} }
) )
} }
fun testCoercionToUnit() { fun testCoercionToUnit() {
return coerceToUnit(fn = local fun fnWithDefault(p0: Int) { return coerceToUnit(fn = local fun fnWithDefault(p0: Int) {
fnWithDefault(a = p0) /*~> Unit */ fnWithDefault(a = p0) /*~> Unit */
} }
) )
@@ -66,14 +66,14 @@ fun testImportedObjectMember(): String {
} }
fun testDefault0(): String { fun testDefault0(): String {
return use0(fn = local fun fnWithDefaults(): String { return use0(fn = local fun fnWithDefaults(): String {
return fnWithDefaults() return fnWithDefaults()
} }
) )
} }
fun testVararg0(): String { fun testVararg0(): String {
return use0(fn = local fun fnWithVarargs(): String { return use0(fn = local fun fnWithVarargs(): String {
return fnWithVarargs() return fnWithVarargs()
} }
) )
@@ -11,7 +11,7 @@ fun sum(vararg args: Int): Int {
} }
fun nsum(vararg args: Number): Int { fun nsum(vararg args: Number): Int {
return sum(args = [*IntArray(size = args.<get-size>(), init = local fun <anonymous>(it: Int): Int { return sum(args = [*IntArray(size = args.<get-size>(), init = local fun <anonymous>(it: Int): Int {
return args.get(index = it).toInt() return args.get(index = it).toInt()
} }
)]) )])
@@ -33,7 +33,7 @@ fun useStringArray(fn: Function1<Array<String>, Unit>) {
} }
fun testPlainArgs() { fun testPlainArgs() {
usePlainArgs(fn = local fun sum(p0: Int, p1: Int): Int { usePlainArgs(fn = local fun sum(p0: Int, p1: Int): Int {
return sum(args = [p0, p1]) return sum(args = [p0, p1])
} }
) )
@@ -48,7 +48,7 @@ fun testArrayAsVararg() {
} }
fun testArrayAndDefaults() { fun testArrayAndDefaults() {
useStringArray(fn = local fun zap(p0: Array<out String>) { useStringArray(fn = local fun zap(p0: Array<out String>) {
zap(b = [*p0]) zap(b = [*p0])
} }
) )
@@ -1,5 +1,5 @@
val test1: Function0<Unit> val test1: Function0<Unit>
field = local fun <anonymous>() { field = local fun <anonymous>() {
42 /*~> Unit */ 42 /*~> Unit */
} }
@@ -18,7 +18,7 @@ abstract enum class X : Enum<X> {
get get
override val value: Function0<String> override val value: Function0<String>
field = local fun <anonymous>(): String { field = local fun <anonymous>(): String {
return B.<get-value2>() return B.<get-value2>()
} }
@@ -27,7 +27,7 @@ open enum class MyEnum : Enum<MyEnum> {
} }
val aLambda: Function0<Unit> val aLambda: Function0<Unit>
field = local fun <anonymous>() { field = local fun <anonymous>() {
Z.<set-counter>(<set-?> = 1) Z.<set-counter>(<set-?> = 1)
Z.foo() Z.foo()
} }
@@ -104,7 +104,7 @@ fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) {
} }
fun testLambdaResultExpression_throws(a: A) { fun testLambdaResultExpression_throws(a: A) {
local fun <anonymous>(): Int { local fun <anonymous>(): Int {
return { // BLOCK return { // BLOCK
val tmp0_subject: A = a val tmp0_subject: A = a
when { when {
@@ -10,11 +10,11 @@ fun foo2(r1: IRunnable, r2: IRunnable, vararg s: String) {
} }
fun test(fn: Function0<Unit>, r: IRunnable, s: String, arr: Array<String>) { fun test(fn: Function0<Unit>, r: IRunnable, s: String, arr: Array<String>) {
foo1(r = local fun <anonymous>() { foo1(r = local fun <anonymous>() {
return Unit return Unit
} }
/*-> IRunnable */, s = [s]) /*-> IRunnable */, s = [s])
foo1(r = local fun <anonymous>() { foo1(r = local fun <anonymous>() {
return Unit return Unit
} }
/*-> IRunnable */, s = [*arr]) /*-> IRunnable */, s = [*arr])
@@ -22,33 +22,33 @@ fun test(fn: Function0<Unit>, r: IRunnable, s: String, arr: Array<String>) {
foo1(r = fn /*-> IRunnable */, s = [*arr]) foo1(r = fn /*-> IRunnable */, s = [*arr])
foo1(r = r, s = [s]) foo1(r = r, s = [s])
foo1(r = r, s = [*arr]) foo1(r = r, s = [*arr])
foo2(r1 = local fun <anonymous>() { foo2(r1 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> IRunnable */, r2 = local fun <anonymous>() { /*-> IRunnable */, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> IRunnable */, s = [s]) /*-> IRunnable */, s = [s])
foo2(r1 = local fun <anonymous>() { foo2(r1 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> IRunnable */, r2 = local fun <anonymous>() { /*-> IRunnable */, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> IRunnable */, s = [*arr]) /*-> IRunnable */, s = [*arr])
foo2(r1 = fn /*-> IRunnable */, r2 = local fun <anonymous>() { foo2(r1 = fn /*-> IRunnable */, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> IRunnable */, s = [s]) /*-> IRunnable */, s = [s])
foo2(r1 = fn /*-> IRunnable */, r2 = local fun <anonymous>() { foo2(r1 = fn /*-> IRunnable */, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> IRunnable */, s = [*arr]) /*-> IRunnable */, s = [*arr])
foo2(r1 = r, r2 = local fun <anonymous>() { foo2(r1 = r, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> IRunnable */, s = [s]) /*-> IRunnable */, s = [s])
foo2(r1 = r, r2 = local fun <anonymous>() { foo2(r1 = r, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> IRunnable */, s = [*arr]) /*-> IRunnable */, s = [*arr])
@@ -8,7 +8,7 @@ fun foo(f: Foo): String {
} }
fun test(): String { fun test(): String {
return foo(f = local fun <anonymous>(): String { return foo(f = local fun <anonymous>(): String {
return "OK" return "OK"
} }
/*-> Foo */) /*-> Foo */)
@@ -55,11 +55,11 @@ val fis: Fn<Int, String>
get get
fun test(j: J) { fun test(j: J) {
j.runConversion(f1 = <get-fsi>(), f2 = local fun <anonymous>(s: String, i: Int, ti: Int): String { j.runConversion(f1 = <get-fsi>(), f2 = local fun <anonymous>(s: String, i: Int, ti: Int): String {
return "" return ""
} }
/*-> Fn<Int, String> */) /*~> Unit */ /*-> Fn<Int, String> */) /*~> Unit */
j.runConversion(f1 = local fun <anonymous>(s: String, i: Int, ts: String): Int { j.runConversion(f1 = local fun <anonymous>(s: String, i: Int, ts: String): Int {
return 1 return 1
} }
/*-> Fn<String, Int> */, f2 = <get-fis>()) /*~> Unit */ /*-> Fn<String, Int> */, f2 = <get-fis>()) /*~> Unit */
@@ -7,20 +7,20 @@ fun useVararg(vararg foos: IFoo) {
} }
fun testLambda() { fun testLambda() {
useVararg(foos = [ local fun <anonymous>(it: Int) { useVararg(foos = [local fun <anonymous>(it: Int) {
return Unit return Unit
} }
/*-> IFoo */]) /*-> IFoo */])
} }
fun testSeveralLambdas() { fun testSeveralLambdas() {
useVararg(foos = [ local fun <anonymous>(it: Int) { useVararg(foos = [local fun <anonymous>(it: Int) {
return Unit return Unit
} }
/*-> IFoo */, local fun <anonymous>(it: Int) { /*-> IFoo */, local fun <anonymous>(it: Int) {
return Unit return Unit
} }
/*-> IFoo */, local fun <anonymous>(it: Int) { /*-> IFoo */, local fun <anonymous>(it: Int) {
return Unit return Unit
} }
/*-> IFoo */]) /*-> IFoo */])
@@ -31,7 +31,7 @@ fun withVarargOfInt(vararg xs: Int): String {
} }
fun testAdaptedCR() { fun testAdaptedCR() {
useVararg(foos = [ local fun withVarargOfInt(p0: Int) { useVararg(foos = [local fun withVarargOfInt(p0: Int) {
withVarargOfInt(xs = [p0]) /*~> Unit */ withVarargOfInt(xs = [p0]) /*~> Unit */
} }
/*-> IFoo */]) /*-> IFoo */])
@@ -6,7 +6,7 @@ fun interface MyRunnable {
fun test(a: Any, r: MyRunnable) { fun test(a: Any, r: MyRunnable) {
when { when {
a is MyRunnable -> { // BLOCK a is MyRunnable -> { // BLOCK
foo(rs = [ local fun <anonymous>() { foo(rs = [local fun <anonymous>() {
return Unit return Unit
} }
/*-> MyRunnable */, r, a /*as MyRunnable */]) /*-> MyRunnable */, r, a /*as MyRunnable */])
@@ -18,7 +18,7 @@ fun testSamConstructor(): KRunnable {
} }
fun testSamCosntructorOnAdapted(): KRunnable { fun testSamCosntructorOnAdapted(): KRunnable {
return local fun foo1() { return local fun foo1() {
foo1() /*~> Unit */ foo1() /*~> Unit */
} }
/*-> KRunnable */ /*-> KRunnable */
@@ -29,7 +29,7 @@ fun testSamConversion() {
} }
fun testSamConversionOnAdapted() { fun testSamConversionOnAdapted() {
use(r = local fun foo1() { use(r = local fun foo1() {
foo1() /*~> Unit */ foo1() /*~> Unit */
} }
/*-> KRunnable */) /*-> KRunnable */)
@@ -3,7 +3,7 @@ fun testSimple(): Box<Long> {
} }
inline fun <reified T : Any?> testArray(n: Int, crossinline block: Function0<T>): Array<T> { inline fun <reified T : Any?> testArray(n: Int, crossinline block: Function0<T>): Array<T> {
return Array<T>(size = n, init = local fun <anonymous>(it: Int): T { return Array<T>(size = n, init = local fun <anonymous>(it: Int): T {
return block.invoke() return block.invoke()
} }
) )
+1 -1
View File
@@ -13,7 +13,7 @@ class A {
get get
init { init {
a().apply<String>(block = local fun String.<anonymous>() { a().apply<String>(block = local fun String.<anonymous>() {
#b = <this> #b = <this>
} }
) /*~> Unit */ ) /*~> Unit */
+3 -3
View File
@@ -9,7 +9,7 @@ operator fun Any.set(index: Function0<Unit>, value: Int) {
} }
fun test1(a: Any) { fun test1(a: Any) {
a.plusAssign(lambda = local fun <anonymous>() { a.plusAssign(lambda = local fun <anonymous>() {
return Unit return Unit
} }
) )
@@ -18,7 +18,7 @@ fun test1(a: Any) {
fun test2(a: Any) { fun test2(a: Any) {
{ // BLOCK { // BLOCK
val tmp0_array: Any = a val tmp0_array: Any = a
val tmp1_index0: Function0<Unit> = local fun <anonymous>() { val tmp1_index0: Function0<Unit> = local fun <anonymous>() {
return Unit return Unit
} }
@@ -29,7 +29,7 @@ fun test2(a: Any) {
fun test3(a: Any) { fun test3(a: Any) {
{ // BLOCK { // BLOCK
val tmp0_array: Any = a val tmp0_array: Any = a
val tmp1_index0: Function0<Unit> = local fun <anonymous>() { val tmp1_index0: Function0<Unit> = local fun <anonymous>() {
return Unit return Unit
} }
@@ -19,28 +19,28 @@ fun <T : Any?> id(x: T): T {
} }
fun test1(): @FlexibleNullability String? { fun test1(): @FlexibleNullability String? {
return checkT<@FlexibleNullability String?>(fn = local fun <anonymous>(): @FlexibleNullability String? { return checkT<@FlexibleNullability String?>(fn = local fun <anonymous>(): @FlexibleNullability String? {
return foo() return foo()
} }
) )
} }
fun test2(): String { fun test2(): String {
return checkT<@EnhancedNullability String>(fn = local fun <anonymous>(): @EnhancedNullability String { return checkT<@EnhancedNullability String>(fn = local fun <anonymous>(): @EnhancedNullability String {
return nnFoo() return nnFoo()
} }
) /*!! String */ ) /*!! String */
} }
fun test3(): @FlexibleNullability String? { fun test3(): @FlexibleNullability String? {
return checkTAny<@FlexibleNullability String?>(fn = local fun <anonymous>(): @FlexibleNullability String? { return checkTAny<@FlexibleNullability String?>(fn = local fun <anonymous>(): @FlexibleNullability String? {
return foo() return foo()
} }
) )
} }
fun test4(): String { fun test4(): String {
return checkTAny<@EnhancedNullability String>(fn = local fun <anonymous>(): @EnhancedNullability String { return checkTAny<@EnhancedNullability String>(fn = local fun <anonymous>(): @EnhancedNullability String {
return nnFoo() return nnFoo()
} }
) /*!! String */ ) /*!! String */
@@ -11,42 +11,42 @@ fun <T : Any?> id(x: T): T {
} }
fun test1(): Any { fun test1(): Any {
return checkAny(fn = local fun <anonymous>(): Any { return checkAny(fn = local fun <anonymous>(): Any {
return foo() /*!! String */ return foo() /*!! String */
} }
) )
} }
val test2: Function0<Any> val test2: Function0<Any>
field = local fun <anonymous>(): @FlexibleNullability String? { field = local fun <anonymous>(): @FlexibleNullability String? {
return foo() /*!! String */ return foo() /*!! String */
} }
get get
val test3: Function0<Any> val test3: Function0<Any>
field = local fun <anonymous>(): @FlexibleNullability String? { field = local fun <anonymous>(): @FlexibleNullability String? {
return foo() return foo()
} }
as Function0<Any> as Function0<Any>
get get
val test4: Function0<Any> val test4: Function0<Any>
field = id<Function0<@FlexibleNullability String?>>(x = local fun <anonymous>(): @FlexibleNullability String? { field = id<Function0<@FlexibleNullability String?>>(x = local fun <anonymous>(): @FlexibleNullability String? {
return foo() return foo()
} }
) )
get get
fun test5(): Any? { fun test5(): Any? {
return checkAnyN(fn = local fun <anonymous>(): Any? { return checkAnyN(fn = local fun <anonymous>(): Any? {
return foo() return foo()
} }
) )
} }
fun test6(): Any? { fun test6(): Any? {
return checkAnyN(fn = local fun <anonymous>(): Any? { return checkAnyN(fn = local fun <anonymous>(): Any? {
return nnFoo() return nnFoo()
} }
) )
@@ -44,7 +44,7 @@ object Z {
} }
val aLambda: Function0<Unit> val aLambda: Function0<Unit>
field = local fun <anonymous>() { field = local fun <anonymous>() {
Z.<set-counter>(<set-?> = 1) Z.<set-counter>(<set-?> = 1)
Z.foo() Z.foo()
Z.<set-counter>(<set-?> = 1) Z.<set-counter>(<set-?> = 1)
@@ -13,7 +13,7 @@ abstract class Base {
object Test : Base { object Test : Base {
private constructor() /* primary */ { private constructor() /* primary */ {
super/*Base*/(lambda = local fun <anonymous>(): Any { super/*Base*/(lambda = local fun <anonymous>(): Any {
return Test return Test
} }
) )
@@ -1,9 +1,9 @@
fun test(fn: Function0<Unit>, r: Runnable, arr: Array<String>) { fun test(fn: Function0<Unit>, r: Runnable, arr: Array<String>) {
foo1(r = local fun <anonymous>() { foo1(r = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = arr) /*~> Unit */ /*-> @FlexibleNullability Runnable? */, strs = arr) /*~> Unit */
foo1(r = local fun <anonymous>() { foo1(r = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*~> Unit */ /*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*~> Unit */
@@ -13,55 +13,55 @@ fun test(fn: Function0<Unit>, r: Runnable, arr: Array<String>) {
foo1(r = fn /*-> @FlexibleNullability Runnable? */, strs = arr) /*~> Unit */ foo1(r = fn /*-> @FlexibleNullability Runnable? */, strs = arr) /*~> Unit */
foo1(r = fn /*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*~> Unit */ foo1(r = fn /*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*~> Unit */
foo1(r = r, strs = [*arr]) /*~> Unit */ foo1(r = r, strs = [*arr]) /*~> Unit */
val i1: Test = Test(r = local fun <anonymous>() { val i1: Test = Test(r = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = arr) /*-> @FlexibleNullability Runnable? */, strs = arr)
val i2: Test = Test(r = local fun <anonymous>() { val i2: Test = Test(r = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*-> @FlexibleNullability Runnable? */, strs = [*arr])
val i3: Test = Test(r1 = local fun <anonymous>() { val i3: Test = Test(r1 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, r2 = local fun <anonymous>() { /*-> @FlexibleNullability Runnable? */, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = arr) /*-> @FlexibleNullability Runnable? */, strs = arr)
val i4: Test = Test(r1 = r, r2 = local fun <anonymous>() { val i4: Test = Test(r1 = r, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = [""]) /*-> @FlexibleNullability Runnable? */, strs = [""])
val i5: Test = Test(r1 = local fun <anonymous>() { val i5: Test = Test(r1 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, r2 = local fun <anonymous>() { /*-> @FlexibleNullability Runnable? */, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*-> @FlexibleNullability Runnable? */, strs = [*arr])
val i6: Test = Test(r1 = r, r2 = local fun <anonymous>() { val i6: Test = Test(r1 = r, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*-> @FlexibleNullability Runnable? */, strs = [*arr])
i1.foo2(r1 = local fun <anonymous>() { i1.foo2(r1 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, r2 = local fun <anonymous>() { /*-> @FlexibleNullability Runnable? */, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = arr) /*~> Unit */ /*-> @FlexibleNullability Runnable? */, strs = arr) /*~> Unit */
i1.foo2(r1 = r, r2 = local fun <anonymous>() { i1.foo2(r1 = r, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = [""]) /*~> Unit */ /*-> @FlexibleNullability Runnable? */, strs = [""]) /*~> Unit */
i1.foo2(r1 = local fun <anonymous>() { i1.foo2(r1 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, r2 = local fun <anonymous>() { /*-> @FlexibleNullability Runnable? */, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*~> Unit */ /*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*~> Unit */
i1.foo2(r1 = r, r2 = local fun <anonymous>() { i1.foo2(r1 = r, r2 = local fun <anonymous>() {
return Unit return Unit
} }
/*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*~> Unit */ /*-> @FlexibleNullability Runnable? */, strs = [*arr]) /*~> Unit */
@@ -1,13 +1,13 @@
fun test(a: SomeJavaClass<out String>) { fun test(a: SomeJavaClass<out String>) {
a.someFunction(hello = local fun <anonymous>(it: @FlexibleNullability String?) { a.someFunction(hello = local fun <anonymous>(it: @FlexibleNullability String?) {
return Unit return Unit
} }
/*-> @FlexibleNullability Hello<Nothing>? */) /*-> @FlexibleNullability Hello<Nothing>? */)
a.plus(hello = local fun <anonymous>(it: @FlexibleNullability String?) { a.plus(hello = local fun <anonymous>(it: @FlexibleNullability String?) {
return Unit return Unit
} }
/*-> @FlexibleNullability Hello<Nothing>? */) /*-> @FlexibleNullability Hello<Nothing>? */)
a.get(hello = local fun <anonymous>(it: @FlexibleNullability String?) { a.get(hello = local fun <anonymous>(it: @FlexibleNullability String?) {
return Unit return Unit
} }
/*-> @FlexibleNullability Hello<Nothing>? */) /*-> @FlexibleNullability Hello<Nothing>? */)
@@ -1,7 +1,7 @@
fun f(x: Any): String { fun f(x: Any): String {
when { when {
x is A<*> -> { // BLOCK x is A<*> -> { // BLOCK
return x /*as A<T> */.call(block = local fun <anonymous>(y: Any?): @FlexibleNullability String? { return x /*as A<T> */.call(block = local fun <anonymous>(y: Any?): @FlexibleNullability String? {
return "OK" return "OK"
} }
/*-> @FlexibleNullability I<@FlexibleNullability T?>? */) /*!! String */ /*-> @FlexibleNullability I<@FlexibleNullability T?>? */) /*!! String */
@@ -1,5 +1,5 @@
fun test1() { fun test1() {
bar(j = local fun <anonymous>(x: Any): @FlexibleNullability Any? { bar(j = local fun <anonymous>(x: Any): @FlexibleNullability Any? {
return x return x
} }
/*-> @FlexibleNullability J<@FlexibleNullability Any?>? */) /*-> @FlexibleNullability J<@FlexibleNullability Any?>? */)
@@ -1,5 +1,5 @@
fun test1(): Runnable { fun test1(): Runnable {
return local fun <anonymous>() { return local fun <anonymous>() {
return Unit return Unit
} }
/*-> Runnable */ /*-> Runnable */
@@ -17,7 +17,7 @@ fun test3(): Runnable {
} }
fun test4(): Comparator<Int> { fun test4(): Comparator<Int> {
return local fun <anonymous>(a: @FlexibleNullability Int?, b: @FlexibleNullability Int?): Int { return local fun <anonymous>(a: @FlexibleNullability Int?, b: @FlexibleNullability Int?): Int {
return a /*!! Int */.minus(other = b /*!! Int */) return a /*!! Int */.minus(other = b /*!! Int */)
} }
/*-> Comparator<Int> */ /*-> Comparator<Int> */
@@ -1,19 +1,19 @@
fun test1(): J<String> { fun test1(): J<String> {
return local fun <anonymous>(x: @FlexibleNullability String?): @FlexibleNullability String? { return local fun <anonymous>(x: @FlexibleNullability String?): @FlexibleNullability String? {
return x return x
} }
/*-> J<String> */ /*-> J<String> */
} }
fun test2(): J<@FlexibleNullability String?> { fun test2(): J<@FlexibleNullability String?> {
return local fun <anonymous>(x: String): @FlexibleNullability String? { return local fun <anonymous>(x: String): @FlexibleNullability String? {
return x return x
} }
/*-> J<@FlexibleNullability String?> */ /*-> J<@FlexibleNullability String?> */
} }
fun test3() { fun test3() {
return bar<@FlexibleNullability String?>(j = local fun <anonymous>(x: String): @FlexibleNullability String? { return bar<@FlexibleNullability String?>(j = local fun <anonymous>(x: String): @FlexibleNullability String? {
return x return x
} }
/*-> @FlexibleNullability J<@FlexibleNullability String?>? */) /*-> @FlexibleNullability J<@FlexibleNullability String?>? */)
@@ -4,14 +4,14 @@ fun J.test0(a: Runnable) {
} }
fun test1() { fun test1() {
runStatic(r = local fun <anonymous>() { runStatic(r = local fun <anonymous>() {
test1() test1()
} }
/*-> @FlexibleNullability Runnable? */) /*-> @FlexibleNullability Runnable? */)
} }
fun J.test2() { fun J.test2() {
<this>.runIt(r = local fun <anonymous>() { <this>.runIt(r = local fun <anonymous>() {
test1() test1()
} }
/*-> @FlexibleNullability Runnable? */) /*-> @FlexibleNullability Runnable? */)
@@ -14,7 +14,7 @@ fun <T : Any?> useSuspendExtT(sfn: @ExtensionFunctionType SuspendFunction1<T, Un
} }
fun produceFun(): Function0<Unit> { fun produceFun(): Function0<Unit> {
return local fun <anonymous>() { return local fun <anonymous>() {
return Unit return Unit
} }
@@ -1,5 +1,5 @@
fun String.k(): Function0<String> { fun String.k(): Function0<String> {
return local fun <anonymous>(): String { return local fun <anonymous>(): String {
return <this> return <this>
} }
@@ -1,6 +1,6 @@
val <T : CharSequence> T.gk: Function0<T> val <T : CharSequence> T.gk: Function0<T>
get(): Function0<T> { get(): Function0<T> {
return local fun <anonymous>(): T { return local fun <anonymous>(): T {
return <this> return <this>
} }
@@ -12,7 +12,7 @@ fun testGeneric1(x: String): String {
val <T : Any?> T.kt26531Val: Function0<T> val <T : Any?> T.kt26531Val: Function0<T>
get(): Function0<T> { get(): Function0<T> {
return local fun <no name provided>(): T { return local fun <no name provided>(): T {
return <this> return <this>
} }
@@ -2,7 +2,7 @@ fun run(block: Function0<Unit>) {
} }
fun branch(x: Int) { fun branch(x: Int) {
return run(block = local fun <anonymous>() { return run(block = local fun <anonymous>() {
{ // BLOCK { // BLOCK
val tmp0_subject: Int = x val tmp0_subject: Int = x
when { when {
@@ -21,8 +21,8 @@ class MyCandidate {
} }
private fun <A : Any?> allCandidatesResult(allCandidates: Collection<MyCandidate>): @FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>? { private fun <A : Any?> allCandidatesResult(allCandidates: Collection<MyCandidate>): @FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>? {
return nameNotFound<@FlexibleNullability A?>().apply<@FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>?>(block = local fun @FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>?.<anonymous>() { return nameNotFound<@FlexibleNullability A?>().apply<@FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>?>(block = local fun @FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>?.<anonymous>() {
<this> /*!! OverloadResolutionResultsImpl<@FlexibleNullability A?> */.setAllCandidates<@FlexibleNullability A?>(allCandidates = allCandidates.map<MyCandidate, ResolvedCall<A>>(transform = local fun <anonymous>(it: MyCandidate): ResolvedCall<A> { <this> /*!! OverloadResolutionResultsImpl<@FlexibleNullability A?> */.setAllCandidates<@FlexibleNullability A?>(allCandidates = allCandidates.map<MyCandidate, ResolvedCall<A>>(transform = local fun <anonymous>(it: MyCandidate): ResolvedCall<A> {
return it.<get-resolvedCall>() as ResolvedCall<A> return it.<get-resolvedCall>() as ResolvedCall<A>
} }
)) ))
@@ -46,11 +46,11 @@ class DeepCopyIrTreeWithSymbols {
} }
fun IrTypeParametersContainer.copyTypeParametersFrom(other: IrTypeParametersContainer) { fun IrTypeParametersContainer.copyTypeParametersFrom(other: IrTypeParametersContainer) {
<this>.<set-typeParameters>(<set-?> = other.<get-typeParameters>().map<IrTypeParameter, IrTypeParameter>(transform = local fun <anonymous>(it: IrTypeParameter): IrTypeParameter { <this>.<set-typeParameters>(<set-?> = other.<get-typeParameters>().map<IrTypeParameter, IrTypeParameter>(transform = local fun <anonymous>(it: IrTypeParameter): IrTypeParameter {
return <this>.copyTypeParameter(declaration = it) return <this>.copyTypeParameter(declaration = it)
} }
)) ))
<this>.<get-typeRemapper>().withinScope<Unit>(irTypeParametersContainer = <this>, fn = local fun <anonymous>() { <this>.<get-typeRemapper>().withinScope<Unit>(irTypeParametersContainer = <this>, fn = local fun <anonymous>() {
{ // BLOCK { // BLOCK
val tmp0_iterator: Iterator<Pair<IrTypeParameter, IrTypeParameter>> = <this>.<get-typeParameters>().zip<IrTypeParameter, IrTypeParameter>(other = other.<get-typeParameters>()).iterator() val tmp0_iterator: Iterator<Pair<IrTypeParameter, IrTypeParameter>> = <this>.<get-typeParameters>().zip<IrTypeParameter, IrTypeParameter>(other = other.<get-typeParameters>()).iterator()
while (tmp0_iterator.hasNext()) { // BLOCK while (tmp0_iterator.hasNext()) { // BLOCK
@@ -58,7 +58,7 @@ class DeepCopyIrTreeWithSymbols {
val thisTypeParameter: IrTypeParameter = tmp1_loop_parameter.component1() val thisTypeParameter: IrTypeParameter = tmp1_loop_parameter.component1()
val otherTypeParameter: IrTypeParameter = tmp1_loop_parameter.component2() val otherTypeParameter: IrTypeParameter = tmp1_loop_parameter.component2()
{ // BLOCK { // BLOCK
otherTypeParameter.<get-superTypes>().mapTo<IrType, IrType, MutableList<IrType>>(destination = thisTypeParameter.<get-superTypes>(), transform = local fun <anonymous>(it: IrType): IrType { otherTypeParameter.<get-superTypes>().mapTo<IrType, IrType, MutableList<IrType>>(destination = thisTypeParameter.<get-superTypes>(), transform = local fun <anonymous>(it: IrType): IrType {
return <this>.<get-typeRemapper>().remapType(type = it) return <this>.<get-typeRemapper>().remapType(type = it)
} }
) /*~> Unit */ ) /*~> Unit */
@@ -4,7 +4,7 @@ private const val BACKSLASH: Char
private fun Reader.nextChar(): Char? { private fun Reader.nextChar(): Char? {
return { // BLOCK return { // BLOCK
val tmp0_safe_receiver: Int? = <this>.read().takeUnless<Int>(predicate = local fun <anonymous>(it: Int): Boolean { val tmp0_safe_receiver: Int? = <this>.read().takeUnless<Int>(predicate = local fun <anonymous>(it: Int): Boolean {
return EQEQ(arg0 = it, arg1 = -1) return EQEQ(arg0 = it, arg1 = -1)
} }
) )
@@ -26,7 +26,7 @@ fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) {
val tmp0_safe_receiver: Char? = <this>.nextChar() val tmp0_safe_receiver: Char? = <this>.nextChar()
when { when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
true -> tmp0_safe_receiver.let<Char, @FlexibleNullability StringBuilder?>(block = local fun <anonymous>(it: Char): @FlexibleNullability StringBuilder? { true -> tmp0_safe_receiver.let<Char, @FlexibleNullability StringBuilder?>(block = local fun <anonymous>(it: Char): @FlexibleNullability StringBuilder? {
return sb.append(p0 = it) return sb.append(p0 = it)
} }
) )
@@ -1,5 +1,5 @@
val anonymous: Function0<Unit> val anonymous: Function0<Unit>
field = local fun <no name provided>() { field = local fun <no name provided>() {
println() println()
} }
@@ -61,7 +61,7 @@ data class A {
} }
var fn: Function1<A, Int> var fn: Function1<A, Int>
field = local fun <anonymous>(<name for destructuring parameter 0>: A): Int { field = local fun <anonymous>(<name for destructuring parameter 0>: A): Int {
val y: Int = <name for destructuring parameter 0>.component2() val y: Int = <name for destructuring parameter 0>.component2()
return 42.plus(other = y) return 42.plus(other = y)
} }
+1 -1
View File
@@ -1,5 +1,5 @@
fun test1(): Int { fun test1(): Int {
return "42".run<String, Int>(block = local fun String.<anonymous>(): Int { return "42".run<String, Int>(block = local fun String.<anonymous>(): Int {
return <this>.<get-length>() return <this>.<get-length>()
} }
) )
+2 -2
View File
@@ -1,12 +1,12 @@
val test1: Function0<Int> val test1: Function0<Int>
field = local fun <anonymous>(): Int { field = local fun <anonymous>(): Int {
return 42 return 42
} }
get get
val test2: Function0<Unit> val test2: Function0<Unit>
field = local fun <anonymous>() { field = local fun <anonymous>() {
return Unit return Unit
} }
@@ -32,9 +32,9 @@ interface IInvoke {
} }
fun test(fooImpl: IFoo, invokeImpl: IInvoke) { fun test(fooImpl: IFoo, invokeImpl: IInvoke) {
with<A, Int>(receiver = A, block = local fun A.<anonymous>(): Int { with<A, Int>(receiver = A, block = local fun A.<anonymous>(): Int {
return with<IFoo, Int>(receiver = fooImpl, block = local fun IFoo.<anonymous>(): Int { return with<IFoo, Int>(receiver = fooImpl, block = local fun IFoo.<anonymous>(): Int {
return with<IInvoke, Int>(receiver = invokeImpl, block = local fun IInvoke.<anonymous>(): Int { return with<IInvoke, Int>(receiver = invokeImpl, block = local fun IInvoke.<anonymous>(): Int {
return (<this>, (<this>, <this>).<get-foo>()).invoke() return (<this>, (<this>, <this>).<get-foo>()).invoke()
} }
) )
+7 -7
View File
@@ -1,27 +1,27 @@
fun test0() { fun test0() {
run<Nothing>(block = local fun <anonymous>(): Nothing { run<Nothing>(block = local fun <anonymous>(): Nothing {
return Unit return Unit
} }
) )
} }
fun test1() { fun test1() {
run<Unit>(block = local fun <anonymous>() { run<Unit>(block = local fun <anonymous>() {
return Unit return Unit
} }
) )
} }
fun test2() { fun test2() {
run<Unit>(block = local fun <anonymous>() { run<Unit>(block = local fun <anonymous>() {
return Unit return Unit
} }
) )
} }
fun test3() { fun test3() {
run<Unit>(block = local fun <anonymous>() { run<Unit>(block = local fun <anonymous>() {
run<Nothing>(block = local fun <anonymous>(): Nothing { run<Nothing>(block = local fun <anonymous>(): Nothing {
return Unit return Unit
} }
) )
@@ -30,7 +30,7 @@ fun test3() {
} }
fun testLrmFoo1(ints: List<Int>) { fun testLrmFoo1(ints: List<Int>) {
ints.forEach<Int>(action = local fun <anonymous>(it: Int) { ints.forEach<Int>(action = local fun <anonymous>(it: Int) {
when { when {
EQEQ(arg0 = it, arg1 = 0) -> return Unit EQEQ(arg0 = it, arg1 = 0) -> return Unit
} }
@@ -40,7 +40,7 @@ fun testLrmFoo1(ints: List<Int>) {
} }
fun testLrmFoo2(ints: List<Int>) { fun testLrmFoo2(ints: List<Int>) {
ints.forEach<Int>(action = local fun <anonymous>(it: Int) { ints.forEach<Int>(action = local fun <anonymous>(it: Int) {
when { when {
EQEQ(arg0 = it, arg1 = 0) -> return Unit EQEQ(arg0 = it, arg1 = 0) -> return Unit
} }
+1 -1
View File
@@ -1,5 +1,5 @@
fun test1() { fun test1() {
val hello: Runnable = local fun <anonymous>() { val hello: Runnable = local fun <anonymous>() {
println(message = "Hello, world!") println(message = "Hello, world!")
} }
/*-> Runnable */ /*-> Runnable */
@@ -1,5 +1,5 @@
fun <T : Any?> problematic(lss: List<List<T>>): List<T> { fun <T : Any?> problematic(lss: List<List<T>>): List<T> {
return lss.flatMap<List<T>, @FlexibleNullability T?>(transform = local fun <anonymous>(it: List<T>): @EnhancedNullability MutableList<@FlexibleNullability T?> { return lss.flatMap<List<T>, @FlexibleNullability T?>(transform = local fun <anonymous>(it: List<T>): @EnhancedNullability MutableList<@FlexibleNullability T?> {
return id<@FlexibleNullability T?>(v = it) /*!! List<@FlexibleNullability T?> */ return id<@FlexibleNullability T?>(v = it) /*!! List<@FlexibleNullability T?> */
} }
) )
+1 -1
View File
@@ -1,7 +1,7 @@
fun <K1 : Any?, V1 : Any?> Map<out K1, V1>.plus(pair: Pair<K1, V1>): Map<K1, V1> { fun <K1 : Any?, V1 : Any?> Map<out K1, V1>.plus(pair: Pair<K1, V1>): Map<K1, V1> {
return when { return when {
<this>.isEmpty() -> mapOf<K1, V1>(pair = pair) <this>.isEmpty() -> mapOf<K1, V1>(pair = pair)
true -> LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>(p0 = <this>).apply<LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>>(block = local fun LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>.<anonymous>() { true -> LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>(p0 = <this>).apply<LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>>(block = local fun LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>.<anonymous>() {
<this>.put(key = pair.<get-first>(), value = pair.<get-second>()) /*~> Unit */ <this>.put(key = pair.<get-first>(), value = pair.<get-second>()) /*~> Unit */
} }
) )
@@ -1,8 +1,8 @@
@OptIn(markerClass = [ExperimentalTypeInference::class]) @OptIn(markerClass = [ExperimentalTypeInference::class])
fun <R : Any?> scopedFlow(block: @ExtensionFunctionType SuspendFunction2<CoroutineScope, FlowCollector<R>, Unit>): Flow<R> { fun <R : Any?> scopedFlow(block: @ExtensionFunctionType SuspendFunction2<CoroutineScope, FlowCollector<R>, Unit>): Flow<R> {
return flow<R>(block = local suspend fun FlowCollector<R>.<anonymous>() { return flow<R>(block = local suspend fun FlowCollector<R>.<anonymous>() {
val collector: FlowCollector<R> = <this> val collector: FlowCollector<R> = <this>
flowScope<Unit>(block = local suspend fun CoroutineScope.<anonymous>() { flowScope<Unit>(block = local suspend fun CoroutineScope.<anonymous>() {
block.invoke(p1 = <this>, p2 = collector) block.invoke(p1 = <this>, p2 = collector)
} }
) )
@@ -11,7 +11,7 @@ fun <R : Any?> scopedFlow(block: @ExtensionFunctionType SuspendFunction2<Corouti
} }
fun <T : Any?> Flow<T>.onCompletion(action: @ExtensionFunctionType SuspendFunction2<FlowCollector<T>, @ParameterName(name = "cause") Throwable?, Unit>): Flow<T> { fun <T : Any?> Flow<T>.onCompletion(action: @ExtensionFunctionType SuspendFunction2<FlowCollector<T>, @ParameterName(name = "cause") Throwable?, Unit>): Flow<T> {
return unsafeFlow<T>(block = local suspend fun FlowCollector<T>.<anonymous>() { return unsafeFlow<T>(block = local suspend fun FlowCollector<T>.<anonymous>() {
val safeCollector: SafeCollector<T> = SafeCollector<T>(collector = <this>) val safeCollector: SafeCollector<T> = SafeCollector<T>(collector = <this>)
safeCollector.invokeSafely<T>(action = action) safeCollector.invokeSafely<T>(action = action)
} }
@@ -28,16 +28,16 @@ inline fun <T : Any?> unsafeFlow(crossinline block: @ExtensionFunctionType Suspe
@Deprecated(message = "binary compatibility with a version w/o FlowCollector receiver", level = DeprecationLevel) @Deprecated(message = "binary compatibility with a version w/o FlowCollector receiver", level = DeprecationLevel)
fun <T : Any?> Flow<T>.onCompletion(action: SuspendFunction1<@ParameterName(name = "cause") Throwable?, Unit>): Flow<T> { fun <T : Any?> Flow<T>.onCompletion(action: SuspendFunction1<@ParameterName(name = "cause") Throwable?, Unit>): Flow<T> {
return <this>.onCompletion<T>(action = local suspend fun FlowCollector<T>.<anonymous>(it: Throwable?) { return <this>.onCompletion<T>(action = local suspend fun FlowCollector<T>.<anonymous>(it: Throwable?) {
action.invoke(p1 = it) action.invoke(p1 = it)
} }
) )
} }
private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel<Any> { private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel<Any> {
return <this>.produce<Any>(block = local suspend fun ProducerScope<Any>.<anonymous>() { return <this>.produce<Any>(block = local suspend fun ProducerScope<Any>.<anonymous>() {
val channel: ChannelCoroutine<Any> = <this>.<get-channel>() as ChannelCoroutine<Any> val channel: ChannelCoroutine<Any> = <this>.<get-channel>() as ChannelCoroutine<Any>
flow.collect<Any?>(action = local suspend fun <anonymous>(value: Any?) { flow.collect<Any?>(action = local suspend fun <anonymous>(value: Any?) {
return channel.sendFair(element = { // BLOCK return channel.sendFair(element = { // BLOCK
val tmp0_elvis_lhs: Any? = value val tmp0_elvis_lhs: Any? = value
when { when {
@@ -52,8 +52,8 @@ private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel<Any> {
} }
private fun CoroutineScope.asChannel(flow: Flow<*>): ReceiveChannel<Any> { private fun CoroutineScope.asChannel(flow: Flow<*>): ReceiveChannel<Any> {
return <this>.produce<Any>(block = local suspend fun ProducerScope<Any>.<anonymous>() { return <this>.produce<Any>(block = local suspend fun ProducerScope<Any>.<anonymous>() {
flow.collect<Any?>(action = local suspend fun <anonymous>(value: Any?) { flow.collect<Any?>(action = local suspend fun <anonymous>(value: Any?) {
return <this>.<get-channel>().send(e = { // BLOCK return <this>.<get-channel>().send(e = { // BLOCK
val tmp0_elvis_lhs: Any? = value val tmp0_elvis_lhs: Any? = value
when { when {
@@ -2,7 +2,7 @@ fun use(fn: Function0<Unit>) {
} }
fun test() { fun test() {
use(fn = local fun <anonymous>() { use(fn = local fun <anonymous>() {
42 /*~> Unit */ 42 /*~> Unit */
} }
) )
@@ -29,7 +29,7 @@ fun <T : Any?> run(fn: Function0<T>): T {
} }
fun foo(): Any { fun foo(): Any {
return run<Any>(fn = local fun <anonymous>(): Any { return run<Any>(fn = local fun <anonymous>(): Any {
val mm: B = B() val mm: B = B()
val nn: C = C() val nn: C = C()
val c: Any = when { val c: Any = when {
@@ -29,7 +29,7 @@ fun <T : Any?> run(fn: Function0<T>): T {
} }
fun foo(): Any { fun foo(): Any {
return run<Any>(fn = local fun <anonymous>(): Any { return run<Any>(fn = local fun <anonymous>(): Any {
val mm: B = B() val mm: B = B()
val nn: C = C() val nn: C = C()
val c: Any = when { val c: Any = when {
@@ -3,7 +3,7 @@ fun <T : Any?> useT(fn: Function0<T>): T {
} }
fun testNoNullCheck() { fun testNoNullCheck() {
useT<@EnhancedNullability String>(fn = local fun <anonymous>(): @EnhancedNullability String { useT<@EnhancedNullability String>(fn = local fun <anonymous>(): @EnhancedNullability String {
return notNullString() return notNullString()
} }
) /*~> Unit */ ) /*~> Unit */
@@ -3,7 +3,7 @@ fun <T : Any> useTAny(fn: Function0<T>): T {
} }
fun testNoNullCheck() { fun testNoNullCheck() {
useTAny<@EnhancedNullability String>(fn = local fun <anonymous>(): @EnhancedNullability String { useTAny<@EnhancedNullability String>(fn = local fun <anonymous>(): @EnhancedNullability String {
return notNullString() return notNullString()
} }
) /*~> Unit */ ) /*~> Unit */
@@ -3,7 +3,7 @@ fun <T : Any?> useTConstrained(xs: Array<T>, fn: Function0<T>): T {
} }
fun testWithNullCheck(xs: Array<String>) { fun testWithNullCheck(xs: Array<String>) {
useTConstrained<String>(xs = xs, fn = local fun <anonymous>(): String { useTConstrained<String>(xs = xs, fn = local fun <anonymous>(): String {
return notNullString() /*!! String */ return notNullString() /*!! String */
} }
) /*~> Unit */ ) /*~> Unit */
@@ -3,7 +3,7 @@ fun <T : Any?> useTX(x: T, fn: Function0<T>): T {
} }
fun testWithNullCheck(xs: Array<String>) { fun testWithNullCheck(xs: Array<String>) {
useTX<Serializable>(x = xs, fn = local fun <anonymous>(): Serializable { useTX<Serializable>(x = xs, fn = local fun <anonymous>(): Serializable {
return notNullString() /*!! String */ return notNullString() /*!! String */
} }
) /*~> Unit */ ) /*~> Unit */
@@ -3,7 +3,7 @@ fun <T : Any?> useTX(x: T, fn: Function0<T>): T {
} }
fun testWithNullCheck() { fun testWithNullCheck() {
useTX<String>(x = "", fn = local fun <anonymous>(): String { useTX<String>(x = "", fn = local fun <anonymous>(): String {
return notNullString() /*!! String */ return notNullString() /*!! String */
} }
) /*~> Unit */ ) /*~> Unit */
@@ -3,7 +3,7 @@ fun <T : Any?> useT(fn: Function0<T>): T {
} }
fun testNoNullCheck() { fun testNoNullCheck() {
useT<@FlexibleNullability String?>(fn = local fun <anonymous>(): @FlexibleNullability String? { useT<@FlexibleNullability String?>(fn = local fun <anonymous>(): @FlexibleNullability String? {
return string() return string()
} }
) /*~> Unit */ ) /*~> Unit */
@@ -3,7 +3,7 @@ fun <T : Any> useTAny(fn: Function0<T>): T {
} }
fun testNoNullCheck() { fun testNoNullCheck() {
useTAny<@FlexibleNullability String?>(fn = local fun <anonymous>(): @FlexibleNullability String? { useTAny<@FlexibleNullability String?>(fn = local fun <anonymous>(): @FlexibleNullability String? {
return string() return string()
} }
) /*~> Unit */ ) /*~> Unit */
@@ -3,7 +3,7 @@ fun <T : Any?> useTConstrained(xs: Array<T>, fn: Function0<T>): T {
} }
fun testWithNullCheck(xs: Array<String>) { fun testWithNullCheck(xs: Array<String>) {
useTConstrained<String>(xs = xs, fn = local fun <anonymous>(): String { useTConstrained<String>(xs = xs, fn = local fun <anonymous>(): String {
return string() /*!! String */ return string() /*!! String */
} }
) /*~> Unit */ ) /*~> Unit */
@@ -3,7 +3,7 @@ fun <T : Any?> useTX(x: T, fn: Function0<T>): T {
} }
fun testNoNullCheck(xs: Array<String>) { fun testNoNullCheck(xs: Array<String>) {
useTX<@FlexibleNullability Serializable?>(x = xs, fn = local fun <anonymous>(): @FlexibleNullability Serializable? { useTX<@FlexibleNullability Serializable?>(x = xs, fn = local fun <anonymous>(): @FlexibleNullability Serializable? {
return string() return string()
} }
) /*~> Unit */ ) /*~> Unit */
@@ -3,7 +3,7 @@ fun <T : Any?> useTX(x: T, fn: Function0<T>): T {
} }
fun testNoNullCheck() { fun testNoNullCheck() {
useTX<@FlexibleNullability String?>(x = "", fn = local fun <anonymous>(): @FlexibleNullability String? { useTX<@FlexibleNullability String?>(x = "", fn = local fun <anonymous>(): @FlexibleNullability String? {
return string() return string()
} }
) /*~> Unit */ ) /*~> Unit */