diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt10322.kt b/compiler/testData/diagnostics/tests/controlStructures/kt10322.kt index 36f0ddca628..8d255c0e911 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt10322.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt10322.kt @@ -1,5 +1,3 @@ -fun run(block: () -> T) : T = block() - fun test1() { run { if (true) { diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt10322.txt b/compiler/testData/diagnostics/tests/controlStructures/kt10322.txt index 5ef0eb35ede..29698cb2b81 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt10322.txt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt10322.txt @@ -1,4 +1,3 @@ package -public fun run(/*0*/ block: () -> T): T public fun test1(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt10706.kt b/compiler/testData/diagnostics/tests/controlStructures/kt10706.kt index ceb3b4ea3fe..a96043b6001 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt10706.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt10706.kt @@ -1,5 +1,3 @@ -fun TODO(): Nothing = null!! - fun fn(c: Char?): Any? = if (c == null) TODO() else when (c) { diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt10706.txt b/compiler/testData/diagnostics/tests/controlStructures/kt10706.txt index c2d9fd98315..a3399fbc6fc 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt10706.txt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt10706.txt @@ -1,4 +1,3 @@ package -public fun TODO(): kotlin.Nothing public fun fn(/*0*/ c: kotlin.Char?): kotlin.Any? diff --git a/compiler/testData/diagnostics/tests/exposed/local.kt b/compiler/testData/diagnostics/tests/exposed/local.kt index fd896c741c4..78a6f3cc2a1 100644 --- a/compiler/testData/diagnostics/tests/exposed/local.kt +++ b/compiler/testData/diagnostics/tests/exposed/local.kt @@ -1,7 +1,3 @@ -fun run(f: () -> T): T { - return f() -} - // invalid, depends on local class fun foo() = run { class A diff --git a/compiler/testData/diagnostics/tests/exposed/local.txt b/compiler/testData/diagnostics/tests/exposed/local.txt index 9940c7bbdeb..e25a560afe2 100644 --- a/compiler/testData/diagnostics/tests/exposed/local.txt +++ b/compiler/testData/diagnostics/tests/exposed/local.txt @@ -3,7 +3,6 @@ package public fun bar(): My public fun foo(): foo..A public fun gav(): () -> gav..B -public fun run(/*0*/ f: () -> T): T public abstract class My { public constructor My() diff --git a/compiler/testData/diagnostics/tests/exposed/localInFunReturnType.kt b/compiler/testData/diagnostics/tests/exposed/localInFunReturnType.kt index 80f2caab66b..663553abb65 100644 --- a/compiler/testData/diagnostics/tests/exposed/localInFunReturnType.kt +++ b/compiler/testData/diagnostics/tests/exposed/localInFunReturnType.kt @@ -1,7 +1,3 @@ -fun run(f: () -> T): T { - return f() -} - class My(val value: T) open class Base diff --git a/compiler/testData/diagnostics/tests/exposed/localInFunReturnType.txt b/compiler/testData/diagnostics/tests/exposed/localInFunReturnType.txt index c59df0b8916..077f40839c5 100644 --- a/compiler/testData/diagnostics/tests/exposed/localInFunReturnType.txt +++ b/compiler/testData/diagnostics/tests/exposed/localInFunReturnType.txt @@ -5,7 +5,6 @@ public fun invalid2(): My> public fun invalid3(): My> public fun invalid4(): My.Local>> public fun invalid5(): My.invalid5a..Local> -public fun run(/*0*/ f: () -> T): T public fun valid1(): kotlin.Any public fun valid2(): Base public fun valid3(): My diff --git a/compiler/testData/diagnostics/tests/exposed/localInMemberType.kt b/compiler/testData/diagnostics/tests/exposed/localInMemberType.kt index 27b35ddcb7f..da900209967 100644 --- a/compiler/testData/diagnostics/tests/exposed/localInMemberType.kt +++ b/compiler/testData/diagnostics/tests/exposed/localInMemberType.kt @@ -1,6 +1,3 @@ -fun run(f: () -> T): T = f() - - class Something { public val publicVal1 = object { override fun toString() = "!" } protected val protectedVal1 = object { override fun toString() = "!" } diff --git a/compiler/testData/diagnostics/tests/exposed/localInMemberType.txt b/compiler/testData/diagnostics/tests/exposed/localInMemberType.txt index 44735439fc8..bb4da193a41 100644 --- a/compiler/testData/diagnostics/tests/exposed/localInMemberType.txt +++ b/compiler/testData/diagnostics/tests/exposed/localInMemberType.txt @@ -1,7 +1,5 @@ package -public fun run(/*0*/ f: () -> T): T - public final class Something { public constructor Something() internal final val internalVal1: kotlin.Any diff --git a/compiler/testData/diagnostics/tests/exposed/localInPropertyType.kt b/compiler/testData/diagnostics/tests/exposed/localInPropertyType.kt index f9d4fbc7030..0cbe05741a8 100644 --- a/compiler/testData/diagnostics/tests/exposed/localInPropertyType.kt +++ b/compiler/testData/diagnostics/tests/exposed/localInPropertyType.kt @@ -1,7 +1,3 @@ -fun run(f: () -> T): T { - return f() -} - class My(val value: T) open class Base diff --git a/compiler/testData/diagnostics/tests/exposed/localInPropertyType.txt b/compiler/testData/diagnostics/tests/exposed/localInPropertyType.txt index 698ff01d067..7c9ebb0551b 100644 --- a/compiler/testData/diagnostics/tests/exposed/localInPropertyType.txt +++ b/compiler/testData/diagnostics/tests/exposed/localInPropertyType.txt @@ -12,7 +12,6 @@ public val valid4: My public val valid5: My public val valid6: My public val valid7: My> -public fun run(/*0*/ f: () -> T): T public open class Base { public constructor Base() diff --git a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt index bc020aac0a6..261eb3a2266 100644 --- a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt +++ b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt @@ -16,5 +16,3 @@ fun main(args: Array) { findByName("") } } - -fun with(t: T, f: T.() -> Unit) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.txt b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.txt index 25276630ff2..372c8a96c45 100644 --- a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.txt +++ b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.txt @@ -1,7 +1,6 @@ package public fun main(/*0*/ args: kotlin.Array): kotlin.Unit -public fun with(/*0*/ t: T, /*1*/ f: T.() -> kotlin.Unit): kotlin.Unit public final class Foo { public constructor Foo() diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/NameDeprecation.kt b/compiler/testData/diagnostics/tests/functionAsExpression/NameDeprecation.kt index cdabd0602df..7001c01a6ee 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/NameDeprecation.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/NameDeprecation.kt @@ -1,6 +1,4 @@ fun foo() { - fun run(block: () -> Unit) = block() - class A fun bar() {} (fun bar() {}) diff --git a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt index 8f57632a957..de80476b1b5 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt @@ -15,4 +15,3 @@ fun test(bal: Array) { val d = run { bar += 4 } checkSubtype(d) } -fun run(f: () -> T): T = f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.txt b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.txt index b6288773cef..e88f2b35672 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.txt @@ -1,4 +1,3 @@ package -public fun run(/*0*/ f: () -> T): T public fun test(/*0*/ bal: kotlin.Array): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt index c9d27ff6ac3..e44e703c4bb 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt @@ -13,4 +13,3 @@ fun test(bal: Array) { val f: Int = run { bar += 4 } } -fun run(f: () -> T): T = f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.txt b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.txt index b6288773cef..e88f2b35672 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.txt @@ -1,4 +1,3 @@ package -public fun run(/*0*/ f: () -> T): T public fun test(/*0*/ bal: kotlin.Array): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt2906.kt b/compiler/testData/diagnostics/tests/functionLiterals/kt2906.kt index 0e19662bf89..6634b46c0fc 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt2906.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt2906.kt @@ -19,5 +19,4 @@ fun main(args: Array) { foo2 { println ("foo2")} // prints "foo2" } -fun run(f: () -> T) : T = f() fun println(s: String) = s diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt2906.txt b/compiler/testData/diagnostics/tests/functionLiterals/kt2906.txt index 23ede04ee96..01c4c4becba 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt2906.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt2906.txt @@ -5,5 +5,4 @@ package bug { public fun foo2(/*0*/ bar: () -> kotlin.Unit): kotlin.Unit public fun main(/*0*/ args: kotlin.Array): kotlin.Unit public fun println(/*0*/ s: kotlin.String): kotlin.String - public fun run(/*0*/ f: () -> T): T } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt6869.kt b/compiler/testData/diagnostics/tests/functionLiterals/kt6869.kt index 82d0d6a4641..644d03be805 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt6869.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt6869.kt @@ -6,6 +6,5 @@ fun main(args : Array) { a?.let { list += it } } -fun T.let(f: (T) -> R): R = f(this) operator fun Iterable.plus(element: T): List = null!! fun listOf(vararg values: T): List = null!! \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt6869.txt b/compiler/testData/diagnostics/tests/functionLiterals/kt6869.txt index b1bc96bd330..d8419bacd40 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt6869.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt6869.txt @@ -2,5 +2,4 @@ package public fun listOf(/*0*/ vararg values: T /*kotlin.Array*/): kotlin.collections.List public fun main(/*0*/ args: kotlin.Array): kotlin.Unit -public fun T.let(/*0*/ f: (T) -> R): R public operator fun kotlin.collections.Iterable.plus(/*0*/ element: T): kotlin.collections.List diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt index ba262988562..a0417a8fcca 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt @@ -4,5 +4,3 @@ fun test2() { val x = run f@{return@f 1} checkSubtype(x) } - -fun run(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.txt index e3b4f561d23..c65a2992bf8 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.txt @@ -1,4 +1,3 @@ package -public fun run(/*0*/ f: () -> T): T public fun test2(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt index 2e6f63245cc..4e10c2dba99 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt @@ -10,5 +10,3 @@ fun test1() { val x = run(l@{return@l 1}) checkSubtype(x) } - -fun run(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.txt index 423265a50eb..8e6fbaa06a3 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.txt @@ -1,5 +1,4 @@ package -public fun run(/*0*/ f: () -> T): T public fun test(): kotlin.Unit public fun test1(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt index 4b5d65c6897..4a429e71059 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt @@ -1,9 +1,7 @@ // !CHECK_TYPE fun test() { - run1 f@{ + run f@{ checkSubtype(return@f 1) } } - -fun run1(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.txt index 2d419df0123..93e27f34c8c 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.txt @@ -1,4 +1,3 @@ package -public fun run1(/*0*/ f: () -> T): T public fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt index 417489961e0..0aad15f653f 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt @@ -10,5 +10,3 @@ fun test() { } checkSubtype(x) } - -fun run(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.txt index 02dc653af39..93e27f34c8c 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.txt @@ -1,4 +1,3 @@ package -public fun run(/*0*/ f: () -> T): T public fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt index 408754306c2..db53a69beab 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt @@ -9,5 +9,3 @@ fun test() { } checkSubtype(x) } - -fun run(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.txt index 02dc653af39..93e27f34c8c 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.txt @@ -1,4 +1,3 @@ package -public fun run(/*0*/ f: () -> T): T public fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt index 1897bd88617..758b5b2a188 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt @@ -4,5 +4,3 @@ fun test(a: Int) { else return@f 1 } } - -fun run(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.txt index 0f3e70f7d40..ad4c29ea908 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.txt @@ -1,4 +1,3 @@ package -public fun run(/*0*/ f: () -> T): T public fun test(/*0*/ a: kotlin.Int): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt index 1fa8186eb97..5d19e6ac54c 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt @@ -7,5 +7,3 @@ fun test(a: Int) { } checkSubtype(x) } - -fun run(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.txt index 0f3e70f7d40..ad4c29ea908 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.txt @@ -1,4 +1,3 @@ package -public fun run(/*0*/ f: () -> T): T public fun test(/*0*/ a: kotlin.Int): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt index 28639836310..6a4952a6644 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt @@ -1,5 +1,4 @@ val flag = true -fun run(f: () -> T): T { return f() } // type of a was checked by txt val a = run { // () -> Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.txt index e798947d2ab..38279cf0504 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.txt @@ -4,4 +4,3 @@ public val a: kotlin.Unit public val b: kotlin.Unit public val c: kotlin.Unit public val flag: kotlin.Boolean = true -public fun run(/*0*/ f: () -> T): T diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt index c1008c00047..cbd5a98bb4d 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt @@ -7,5 +7,3 @@ fun test(a: Int) { run{ "" } run{ 1 } } - -fun run(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.txt index 0f3e70f7d40..ad4c29ea908 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.txt @@ -1,4 +1,3 @@ package -public fun run(/*0*/ f: () -> T): T public fun test(/*0*/ a: kotlin.Int): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt index c54cb94e695..1ee85944f8b 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt @@ -12,5 +12,3 @@ fun test(a: C, b: B) { } checkSubtype(x) } - -fun run(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.txt index 28e0d1dba57..6521c2f3206 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.txt @@ -1,6 +1,5 @@ package -public fun run(/*0*/ f: () -> T): T public fun test(/*0*/ a: C, /*1*/ b: B): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt b/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt index fd99a22e995..97f7a10bcba 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt @@ -5,8 +5,6 @@ fun CharSequence?.bar2() {} fun T.bar3() {} -fun T.let(f: (T) -> R): R = f(this) - fun foo(x: T) { x.length x?.length diff --git a/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.txt b/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.txt index aad2f7e0add..746814bb143 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.txt +++ b/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.txt @@ -4,4 +4,3 @@ public fun foo(/*0*/ x: T): kotlin.Unit public fun T.bar1(): kotlin.Unit public fun kotlin.CharSequence?.bar2(): kotlin.Unit public fun T.bar3(): kotlin.Unit -public fun T.let(/*0*/ f: (T) -> R): R diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.kt index 8f9c3ffb23d..095cb7d57d0 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.kt @@ -4,8 +4,6 @@ class A { } class Out -public inline fun with(receiver: T, f: T.() -> R): R = receiver.f() - fun test(x: A, y: Out) { with(x) { // TODO: this diagnostic could be replaced with TYPE_MISMATCH_DUE_TO_TYPE_PROJECTION diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.txt b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.txt index a3a2d73f56c..d81c8904bc7 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.txt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.txt @@ -1,7 +1,6 @@ package public fun test(/*0*/ x: A, /*1*/ y: Out): kotlin.Unit -public inline fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1944.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt1944.kt index adca39bc9e2..518a6096516 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1944.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt1944.kt @@ -12,5 +12,3 @@ class P { checkSubtype(r) } } - -fun run(f: () -> T) : T = f() diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1944.txt b/compiler/testData/diagnostics/tests/inference/regressions/kt1944.txt index ba5b429e5d5..87433e79ae4 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1944.txt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt1944.txt @@ -1,7 +1,6 @@ package package j { - public fun run(/*0*/ f: () -> T): T public final class P { public constructor P() diff --git a/compiler/testData/diagnostics/tests/labels/kt3920.kt b/compiler/testData/diagnostics/tests/labels/kt3920.kt index b03544a56c7..9ae310acc38 100644 --- a/compiler/testData/diagnostics/tests/labels/kt3920.kt +++ b/compiler/testData/diagnostics/tests/labels/kt3920.kt @@ -7,5 +7,3 @@ fun test() { 2 } } - -fun run(f: () -> T): T = f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/labels/kt3920.txt b/compiler/testData/diagnostics/tests/labels/kt3920.txt index 02dc653af39..93e27f34c8c 100644 --- a/compiler/testData/diagnostics/tests/labels/kt3920.txt +++ b/compiler/testData/diagnostics/tests/labels/kt3920.txt @@ -1,4 +1,3 @@ package -public fun run(/*0*/ f: () -> T): T public fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt index 63e7931aa9f..58c21ffe96d 100644 --- a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt +++ b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt @@ -35,7 +35,5 @@ fun a() { } } -public fun with(receiver: T, f: T.() -> R): R = receiver.f() - fun consumeInt(i: Int) {} fun consumeString(s: String) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.txt b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.txt index 75a995e7e0e..d59313d0921 100644 --- a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.txt +++ b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.txt @@ -3,7 +3,6 @@ package public fun a(): kotlin.Unit public fun consumeInt(/*0*/ i: kotlin.Int): kotlin.Unit public fun consumeString(/*0*/ s: kotlin.String): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public fun Example.div(/*0*/ other: Example): kotlin.Int public operator infix fun Example.minus(/*0*/ other: Example): kotlin.Int public fun Example.plus(/*0*/ other: Example): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.kt b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.kt index 49ae336b5ae..82811b756f2 100644 --- a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.kt +++ b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.kt @@ -41,7 +41,5 @@ fun a() { } } -public fun with(receiver: T, f: T.() -> R): R = receiver.f() - fun consumeInt(i: Int) {} fun consumeString(s: String) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.txt b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.txt index 8debce42588..0bae2ab7a53 100644 --- a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.txt +++ b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.txt @@ -3,7 +3,6 @@ package public fun a(): kotlin.Unit public fun consumeInt(/*0*/ i: kotlin.Int): kotlin.Unit public fun consumeString(/*0*/ s: kotlin.String): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public fun Example.div(/*0*/ other: Example): kotlin.String public operator infix fun Example.minus(/*0*/ other: Example): kotlin.String public fun Example.plus(/*0*/ other: Example): kotlin.String diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.kt index 03812dbf1ba..4ae96335e20 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.kt @@ -43,4 +43,3 @@ fun test() { fun J.foo() {} fun J?.bar() {} -fun with(t: T, f: T.() -> Unit) {} diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.txt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.txt index 8d5c428c26c..f1fc3573b14 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.txt @@ -1,7 +1,6 @@ package public fun test(): kotlin.Unit -public fun with(/*0*/ t: T, /*1*/ f: T.() -> kotlin.Unit): kotlin.Unit public fun J?.bar(): kotlin.Unit public fun J.foo(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.kt index a62b4e4c2fb..e5623f1313a 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.kt @@ -38,6 +38,3 @@ fun test() { foo() } } - -fun with(t: T, f: T.() -> Unit) {} - diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.txt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.txt index 53081c3fa02..0358dfbe9e2 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.txt @@ -1,7 +1,6 @@ package public fun test(): kotlin.Unit -public fun with(/*0*/ t: T, /*1*/ f: T.() -> kotlin.Unit): kotlin.Unit public open class J { public constructor J() diff --git a/compiler/testData/diagnostics/tests/regressions/kt385.109.441.kt b/compiler/testData/diagnostics/tests/regressions/kt385.109.441.kt index 6a201f85e14..51e61f83ba7 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt385.109.441.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt385.109.441.kt @@ -26,7 +26,6 @@ fun generic_invoker(gen : () -> T) : T { fun println(message : Int) { System.out.println(message) } fun println(message : Long) { System.out.println(message) } -inline fun run(body : () -> T) : T = body() fun main(args : Array) { diff --git a/compiler/testData/diagnostics/tests/regressions/kt385.109.441.txt b/compiler/testData/diagnostics/tests/regressions/kt385.109.441.txt index cd33e2bf96e..cd6090a152f 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt385.109.441.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt385.109.441.txt @@ -5,7 +5,6 @@ public fun generic_invoker(/*0*/ gen: () -> T): T public fun main(/*0*/ args: kotlin.Array): kotlin.Unit public fun println(/*0*/ message: kotlin.Int): kotlin.Unit public fun println(/*0*/ message: kotlin.Long): kotlin.Unit -public inline fun run(/*0*/ body: () -> T): T public fun kotlin.collections.Iterable.foreach(/*0*/ operation: (T) -> kotlin.Unit): kotlin.Unit public fun kotlin.collections.Iterable.foreach(/*0*/ operation: (kotlin.Int, T) -> kotlin.Unit): kotlin.Unit public infix fun kotlin.collections.Iterator.foreach(/*0*/ operation: (T) -> kotlin.Unit): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/regressions/kt439.kt b/compiler/testData/diagnostics/tests/regressions/kt439.kt index dd34d7faa68..f8ffd0b6a03 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt439.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt439.kt @@ -1,7 +1,5 @@ // KT-439 Support labeled function literals in call arguments -inline fun run1(body : () -> T) : T = body() - fun main1(args : Array) { - run1 l@{ 1 } // should not be an error + run l@{ 1 } // should not be an error } diff --git a/compiler/testData/diagnostics/tests/regressions/kt439.txt b/compiler/testData/diagnostics/tests/regressions/kt439.txt index 1cf4e3ea372..77350c6b768 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt439.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt439.txt @@ -1,4 +1,3 @@ package public fun main1(/*0*/ args: kotlin.Array): kotlin.Unit -public inline fun run1(/*0*/ body: () -> T): T diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.kt index e2cc9ed4bc5..fcd8e258ada 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.kt @@ -31,5 +31,3 @@ fun test(c: () -> String, e: Int.() -> String) { (e)() } } - -fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.txt b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.txt index 8c9b78d2e1d..5af2a9951db 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.txt @@ -2,7 +2,6 @@ package public fun test(/*0*/ c: () -> kotlin.String, /*1*/ e: kotlin.Int.() -> kotlin.String): kotlin.Unit public fun test(/*0*/ a: A, /*1*/ b: B): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.kt index 32e76b75b74..619c7f51c2a 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.kt @@ -19,5 +19,3 @@ fun test(a: A) { } } } - -fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.txt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.txt index a6fd78c4408..e8ef0106949 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.txt @@ -1,7 +1,6 @@ package public fun test(/*0*/ a: A): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class A { public constructor A(/*0*/ x: (kotlin.String.() -> kotlin.Unit)?) diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt index 378cee5d3da..f4f9bacf244 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt @@ -59,6 +59,3 @@ fun test(d: D, c: C) { } } } - -//-------------- -fun with(receiver: T, f: T.() -> R) : R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.txt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.txt index 86bd81e7326..241a018805a 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.txt @@ -5,7 +5,6 @@ public fun test(/*0*/ a: A): kotlin.Unit public fun test(/*0*/ b: B): kotlin.Unit public fun test(/*0*/ d: D, /*1*/ c: C): kotlin.Unit public fun test(/*0*/ foo: Foo): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public operator fun Foo.invoke(): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt index 6ef10cec845..fd841f6fe7e 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt @@ -58,6 +58,3 @@ fun test(d: D, c: C) { } } } - -//-------------- -fun with(receiver: T, f: T.() -> R) : R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.txt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.txt index 4f249d54635..60be37fe4da 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.txt @@ -5,7 +5,6 @@ public fun test(/*0*/ a: A): kotlin.Unit public fun test(/*0*/ b: B): kotlin.Unit public fun test(/*0*/ d: D, /*1*/ c: C): kotlin.Unit public fun test(/*0*/ foo: Foo): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public interface A { public abstract val foo: Foo diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt index 77469d22af0..803ee1c22b7 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt @@ -121,6 +121,3 @@ fun test(u: U, v: V, x: X) { } } } - -//-------------- -fun with(receiver: T, f: T.() -> R) : R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.txt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.txt index 182c275f87d..662b689888f 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.txt @@ -5,7 +5,6 @@ public fun test(/*0*/ c: C, /*1*/ b: B): kotlin.Unit public fun test(/*0*/ e: E, /*1*/ d: D): kotlin.Unit public fun test(/*0*/ g: G, /*1*/ f: F): kotlin.Unit public fun test(/*0*/ u: U, /*1*/ v: V, /*2*/ x: X): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt index 10899548247..638e4bf4909 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt @@ -40,9 +40,6 @@ fun test(a: A, b: B) { } } -public inline fun with(receiver: T, f: T.() -> R): R = receiver.f() - - // FILE: 1.kt package fooIsMember @@ -84,5 +81,3 @@ fun test(a: A, b: B) { } } } - -public inline fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.txt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.txt index 043a96ad5f3..b043baa3613 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.txt @@ -3,7 +3,6 @@ package package fooIsExtension { public val fooIsExtension.A.foo: fooIsExtension.B.() -> kotlin.Unit public fun test(/*0*/ a: fooIsExtension.A, /*1*/ b: fooIsExtension.B): kotlin.Unit - public inline fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class A { public constructor A() @@ -22,7 +21,6 @@ package fooIsExtension { package fooIsMember { public fun test(/*0*/ a: fooIsMember.A, /*1*/ b: fooIsMember.B): kotlin.Unit - public inline fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.kt index b60f5c2fe47..3190359c25b 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.kt @@ -15,5 +15,3 @@ fun test(a: A, b: B) { (a.foo)(this) } } - -public inline fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.txt b/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.txt index 230b1ba4234..6a4f32d29a1 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.txt @@ -1,7 +1,6 @@ package public fun test(/*0*/ a: A, /*1*/ b: B): kotlin.Unit -public inline fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.kt b/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.kt index 4cf52b42931..86df9c03ce8 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.kt @@ -16,5 +16,3 @@ fun test(a: A, b: B) { (a)() } } - -fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.txt b/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.txt index d07320ed21f..16318358405 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.txt @@ -2,7 +2,6 @@ package public val B.a: () -> kotlin.Int public fun test(/*0*/ a: A, /*1*/ b: B): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.kt index 9955a39c782..9c24fdd8879 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.kt @@ -7,6 +7,3 @@ fun test() { } fun foo(x: Int) = x - -// from library -fun with(receiver: T, f: T.() -> R) : R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.txt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.txt index 10a771bca26..ed10c150661 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.txt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.txt @@ -3,5 +3,4 @@ package package c { public fun foo(/*0*/ x: kotlin.Int): kotlin.Int public fun test(): kotlin.Unit - public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R } diff --git a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.kt b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.kt index 0100fcd772d..aede07e6269 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.kt @@ -16,5 +16,3 @@ fun test(foo: A.() -> Int) { } } } - -fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.txt b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.txt index eb0e531c162..c6119e98001 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.txt +++ b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.txt @@ -1,7 +1,6 @@ package public fun test(/*0*/ foo: A.() -> kotlin.Int): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.kt b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.kt index 1553f4e3cd1..ac7e7458842 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.kt @@ -11,5 +11,3 @@ fun test(foo: A.() -> Int) { this.foo() checkType { _() } } } - -fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.txt b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.txt index 568fbfdd799..15874b631b8 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.txt +++ b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.txt @@ -1,7 +1,6 @@ package public fun test(/*0*/ foo: A.() -> kotlin.Int): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/resolve/priority/kt10219.kt b/compiler/testData/diagnostics/tests/resolve/priority/kt10219.kt index 0029475c148..6d6979b3035 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/kt10219.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/kt10219.kt @@ -20,4 +20,3 @@ fun a(c: Calendar) { timeInMillis = "" } } -fun T.apply(f: T.() -> Unit): T { f(); return this } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/priority/kt10219.txt b/compiler/testData/diagnostics/tests/resolve/priority/kt10219.txt index ab8e6e491a6..54c46c1b481 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/kt10219.txt +++ b/compiler/testData/diagnostics/tests/resolve/priority/kt10219.txt @@ -2,7 +2,6 @@ package public var A.timeInMillis: kotlin.String public fun a(/*0*/ c: Calendar): kotlin.Unit -public fun T.apply(/*0*/ f: T.() -> kotlin.Unit): T public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.kt b/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.kt index 9d0f393e7e7..cfee1159917 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.kt @@ -14,6 +14,3 @@ fun test(a: A) { foo() checkType { _() } } } - - -fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.txt b/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.txt index 3c29b197fba..f2588603252 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.txt +++ b/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.txt @@ -1,7 +1,6 @@ package public fun test(/*0*/ a: A): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public fun A.foo(): A public final class A { diff --git a/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.kt b/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.kt index aff7e4da226..4142abaa394 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.kt @@ -16,5 +16,3 @@ fun test(a: A) { this.foo() checkType { _() } } } - -fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.txt b/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.txt index 11b6821450b..30f6330cf24 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.txt +++ b/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.txt @@ -1,7 +1,6 @@ package public fun test(/*0*/ a: A): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.kt b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.kt index 706aa7cd4fe..4efbd0051f2 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.kt @@ -27,5 +27,3 @@ class B { } } } - -fun with(receiver: T, f: T.() -> R): R = receiver.f() diff --git a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.txt b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.txt index a35051a8a2c..3e4d869d523 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.txt +++ b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.txt @@ -2,7 +2,6 @@ package private val A.foo: kotlin.Int public fun test(/*0*/ a: A): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public open class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.kt b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.kt index facc0d01425..83c50b4bd1a 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.kt @@ -34,5 +34,3 @@ fun test(a: A, b: B, c: C) { } } } - -fun with(receiver: T, f: T.() -> R): R = receiver.f() diff --git a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.txt b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.txt index e350b404239..3f16bebb448 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.txt +++ b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.txt @@ -1,7 +1,6 @@ package public fun test(/*0*/ a: A, /*1*/ b: B, /*2*/ c: C): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public open class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/smartCasts/doubleLambdaArgument.kt b/compiler/testData/diagnostics/tests/smartCasts/doubleLambdaArgument.kt index 4c8af5f4b96..c9ffbac55d0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/doubleLambdaArgument.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/doubleLambdaArgument.kt @@ -1,8 +1,6 @@ interface Foo fun foo(): Foo? = null -fun run(f: () -> T): T = f() - val foo: Foo = run { run { val x = foo() diff --git a/compiler/testData/diagnostics/tests/smartCasts/doubleLambdaArgument.txt b/compiler/testData/diagnostics/tests/smartCasts/doubleLambdaArgument.txt index 92911120b87..9a85fd38639 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/doubleLambdaArgument.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/doubleLambdaArgument.txt @@ -2,7 +2,6 @@ package public val foo: Foo public fun foo(): Foo? -public fun run(/*0*/ f: () -> T): T public interface Foo { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithExpectedGenericType.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithExpectedGenericType.kt index b75e112ff9a..825d1039cdf 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithExpectedGenericType.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithExpectedGenericType.kt @@ -1,5 +1,3 @@ -fun run(f: () -> T): T = f() - class My(val y: T?) { fun get(): T = run { diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithExpectedGenericType.txt b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithExpectedGenericType.txt index 4c2cf620d0a..f03295ebe97 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithExpectedGenericType.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithExpectedGenericType.txt @@ -1,7 +1,5 @@ package -public fun run(/*0*/ f: () -> T): T - public final class My { public constructor My(/*0*/ y: T?) public final val y: T? diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutType.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutType.kt index a059db5e212..a585785fd4d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutType.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutType.kt @@ -3,8 +3,6 @@ interface Foo fun foo(): Foo? = null -fun run(f: () -> T): T = f() - val foo: Foo = run { val x = foo() if (x == null) throw Exception() diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutType.txt b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutType.txt index e1f87b8f611..3ba75b64303 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutType.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutType.txt @@ -4,7 +4,6 @@ public val foo: Foo public fun bar(): Foo public fun foo(): Foo? public fun repeat(/*0*/ arg: T): T -public fun run(/*0*/ f: () -> T): T public interface Foo { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutTypeIf.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutTypeIf.kt index 9c0ad1b3650..b08014db68d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutTypeIf.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutTypeIf.kt @@ -1,7 +1,5 @@ // See also KT-7800 -fun T.let(f: (T) -> R): R = f(this) - fun foo(): Int { val x: Int = 1.let { val value: Int? = null diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutTypeIf.txt b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutTypeIf.txt index 3bece41fd06..b02182627c0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutTypeIf.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithoutTypeIf.txt @@ -1,4 +1,3 @@ package public fun foo(): kotlin.Int -public fun T.let(/*0*/ f: (T) -> R): R diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifies.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifies.kt index 12638fe0246..1fc0e820b20 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifies.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifies.kt @@ -1,6 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -fun run(f: () -> Unit) = 0 - fun foo(arg: Int?) { run { var x = arg diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifies.txt b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifies.txt index af98b2de23f..419cb9b50f8 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifies.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifies.txt @@ -1,4 +1,3 @@ package public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Unit -public fun run(/*0*/ f: () -> kotlin.Unit): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInLoop.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInLoop.kt index 77d75a3d730..a340556a0a5 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInLoop.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInLoop.kt @@ -1,6 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -fun run(f: () -> Unit) = 0 - fun foo(arg: Int?) { run { var x = arg diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInLoop.txt b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInLoop.txt index af98b2de23f..419cb9b50f8 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInLoop.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInLoop.txt @@ -1,4 +1,3 @@ package public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Unit -public fun run(/*0*/ f: () -> kotlin.Unit): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInSecondary.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInSecondary.kt index f14e005f3e9..a6c4454638e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInSecondary.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInSecondary.kt @@ -1,6 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -fun run(f: () -> Unit) = 0 - class My { constructor(arg: Int?) { run { diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInSecondary.txt b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInSecondary.txt index 360894576d1..ef68822be2a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInSecondary.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesInSecondary.txt @@ -1,7 +1,5 @@ package -public fun run(/*0*/ f: () -> kotlin.Unit): kotlin.Int - public final class My { public constructor My(/*0*/ arg: kotlin.Int?) public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesWithDirectEq.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesWithDirectEq.kt index e121f76a88e..6003b8a37d3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesWithDirectEq.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesWithDirectEq.kt @@ -1,6 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -fun run(f: () -> Unit) = 0 - fun foo(arg: Int?) = run { var x = arg if (x == null) return@run diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesWithDirectEq.txt b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesWithDirectEq.txt index 74aa1b3b0f6..1eb4e093c70 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesWithDirectEq.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesWithDirectEq.txt @@ -1,7 +1,6 @@ package -public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Int -public fun run(/*0*/ f: () -> kotlin.Unit): kotlin.Int +public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Unit public final class My { public constructor My() diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaUsesOwnerModifies.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaUsesOwnerModifies.kt index aef2f644df7..0889a3aaa16 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaUsesOwnerModifies.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaUsesOwnerModifies.kt @@ -1,6 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -fun run(f: () -> Unit) = 0 - fun foo(arg: Int?) { var x = arg if (x == null) return diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaUsesOwnerModifies.txt b/compiler/testData/diagnostics/tests/smartCasts/lambdaUsesOwnerModifies.txt index af98b2de23f..419cb9b50f8 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaUsesOwnerModifies.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaUsesOwnerModifies.txt @@ -1,4 +1,3 @@ package public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Unit -public fun run(/*0*/ f: () -> kotlin.Unit): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.kt b/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.kt index 22dee62b9a1..7d63e53c8a6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.kt @@ -1,6 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -fun run(f: () -> Unit) = 0 - fun foo(arg: Int?) { var x = arg if (x == null) return diff --git a/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.txt b/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.txt index af98b2de23f..419cb9b50f8 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.txt @@ -1,4 +1,3 @@ package public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Unit -public fun run(/*0*/ f: () -> kotlin.Unit): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.kt index 2521c8aeac7..94ce4126471 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.kt @@ -1,8 +1,6 @@ // See KT-10056 class Foo(val bar: String) -public inline fun T.let(f: (T) -> R): R = f(this) - fun test(foo: Foo?) { foo?.bar.let { // Error, foo?.bar is nullable diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.txt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.txt index 602fd914a30..00437b9eba7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.txt @@ -1,7 +1,6 @@ package public fun test(/*0*/ foo: Foo?): kotlin.Unit -public inline fun T.let(/*0*/ f: (T) -> R): R public final class Foo { public constructor Foo(/*0*/ bar: kotlin.String) diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.kt index 486dcbd3973..556da3f4148 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.kt @@ -4,8 +4,6 @@ class Foo(val bar: Bar, val nbar: Bar?) { fun baz(s: String) = if (s != "") Bar(s) else null } -public inline fun T.let(f: (T) -> R): R = f(this) - fun String?.call(f: (String?) -> String?) = f(this) fun String.notNullLet(f: (String) -> Unit) = f(this) diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.txt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.txt index b15c8e6912e..de689a116e6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.txt @@ -4,7 +4,6 @@ public fun test(/*0*/ foo: Foo?): kotlin.Unit public fun testNotNull(/*0*/ foo: Foo): kotlin.Unit public fun testNullable(/*0*/ foo: Foo?): kotlin.Unit public fun kotlin.String?.call(/*0*/ f: (kotlin.String?) -> kotlin.String?): kotlin.String? -public inline fun T.let(/*0*/ f: (T) -> R): R public fun kotlin.String.notNullLet(/*0*/ f: (kotlin.String) -> kotlin.Unit): kotlin.Unit public final class Bar { diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithExclExcl.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithExclExcl.kt index c0441272b8d..fda9aa6d476 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithExclExcl.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithExclExcl.kt @@ -1,7 +1,5 @@ class Foo(val bar: String?) -public inline fun T.let(f: (T) -> R): R = f(this) - fun test(foo: Foo?) { foo!!.bar.let { // Correct diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithExclExcl.txt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithExclExcl.txt index 1a3e5e25375..a39237ca557 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithExclExcl.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithExclExcl.txt @@ -1,7 +1,6 @@ package public fun test(/*0*/ foo: Foo?): kotlin.Unit -public inline fun T.let(/*0*/ f: (T) -> R): R public final class Foo { public constructor Foo(/*0*/ bar: kotlin.String?) diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.kt index 43aee6ff6a8..4935db0141e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.kt @@ -12,8 +12,6 @@ public class Foo { } // FILE: Test.kt -public inline fun T.let(f: (T) -> R): R = f(this) - fun test() { val foo = Foo.create(null) foo?.bar.let { diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.txt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.txt index 884991819ca..08d0666217e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.txt @@ -1,7 +1,6 @@ package public fun test(): kotlin.Unit -public inline fun T.let(/*0*/ f: (T) -> R): R public open class Foo { private constructor Foo(/*0*/ bar: kotlin.String!) diff --git a/compiler/testData/diagnostics/tests/subtyping/localClasses.kt b/compiler/testData/diagnostics/tests/subtyping/localClasses.kt index ef6b12f4c61..c26c039cf5e 100644 --- a/compiler/testData/diagnostics/tests/subtyping/localClasses.kt +++ b/compiler/testData/diagnostics/tests/subtyping/localClasses.kt @@ -2,10 +2,6 @@ package p -fun run(f: () -> T): T { - return f() -} - private fun foo(a: Int) = run { class A A() diff --git a/compiler/testData/diagnostics/tests/subtyping/localClasses.txt b/compiler/testData/diagnostics/tests/subtyping/localClasses.txt index 6dfc3b90898..91e82744e5c 100644 --- a/compiler/testData/diagnostics/tests/subtyping/localClasses.txt +++ b/compiler/testData/diagnostics/tests/subtyping/localClasses.txt @@ -3,6 +3,5 @@ package package p { private fun foo(): p.foo..A private fun foo(/*0*/ a: kotlin.Int): p.foo..A - public fun run(/*0*/ f: () -> T): T public fun test(): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.kt b/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.kt index 7de8004b5c6..8c120f25fa6 100644 --- a/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.kt +++ b/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.kt @@ -2,10 +2,6 @@ package p -fun run(f: () -> T): T { - return f() -} - private fun foo(a: Int) = run { object { inner class A diff --git a/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.txt b/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.txt index 9f888781e53..4e0bb0e9e9a 100644 --- a/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.txt +++ b/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.txt @@ -3,6 +3,5 @@ package package p { private fun foo(): p.foo...A private fun foo(/*0*/ a: kotlin.Int): p.foo...A - public fun run(/*0*/ f: () -> T): T public fun test(): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.kt b/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.kt index 7a66372714a..96f77f0a5c0 100644 --- a/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.kt +++ b/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.kt @@ -2,10 +2,6 @@ package p -fun run(f: () -> T): T { - return f() -} - private fun foo(a: Int) = run { class A { inner class B diff --git a/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.txt b/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.txt index f0475258b96..1aa9e171126 100644 --- a/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.txt +++ b/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.txt @@ -3,6 +3,5 @@ package package p { private fun foo(): p.foo..A.B private fun foo(/*0*/ a: kotlin.Int): p.foo..A.B - public fun run(/*0*/ f: () -> T): T public fun test(): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.kt index 6f8cd8339bd..01561b75c39 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.kt @@ -1,6 +1,4 @@ fun getT(): T = null!! -fun with(receiver: T, f: T.() -> R): R = receiver.f() - class Test { private fun foo() : I = getT() diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.txt b/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.txt index 3cdedb552fd..7554e82719c 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.txt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.txt @@ -2,7 +2,6 @@ package public fun getT(): T public fun test(/*0*/ t: Test): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class Test { public constructor Test() diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.kt index 8c63924feb6..b951122ad75 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.kt @@ -1,5 +1,4 @@ fun getT(): T = null!! -fun with(receiver: T, f: T.() -> R): R = receiver.f() class Test { private val i: I = getT() diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.txt b/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.txt index 488370208d5..aba7e426a48 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.txt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.txt @@ -2,7 +2,6 @@ package public fun getT(): T public fun test(/*0*/ t: Test): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class Test { public constructor Test() diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.kt index 920498713e6..9e1387d398f 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.kt @@ -1,5 +1,4 @@ fun getT(): T = null!! -fun with(receiver: T, f: T.() -> R): R = receiver.f() class Test { private var i: I = getT() diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.txt b/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.txt index 03e1cc11365..59eac7ab560 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.txt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.txt @@ -2,7 +2,6 @@ package public fun getT(): T public fun test(/*0*/ t: Test): kotlin.Unit -public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R public final class Test { public constructor Test()