Minor. removed functions which declared in Standard.kt from diagnostic testdata.
Removed declaration for functions: TODO, run, with, apply, let.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
interface Foo
|
||||
fun foo(): Foo? = null
|
||||
|
||||
fun <T> run(f: () -> T): T = f()
|
||||
|
||||
val foo: Foo = run {
|
||||
run {
|
||||
val x = foo()
|
||||
|
||||
@@ -2,7 +2,6 @@ package
|
||||
|
||||
public val foo: Foo
|
||||
public fun foo(): Foo?
|
||||
public fun </*0*/ T> run(/*0*/ f: () -> T): T
|
||||
|
||||
public interface Foo {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
fun <T> run(f: () -> T): T = f()
|
||||
|
||||
class My<T: Any>(val y: T?) {
|
||||
|
||||
fun get(): T = run {
|
||||
|
||||
-2
@@ -1,7 +1,5 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> run(/*0*/ f: () -> T): T
|
||||
|
||||
public final class My</*0*/ T : kotlin.Any> {
|
||||
public constructor My</*0*/ T : kotlin.Any>(/*0*/ y: T?)
|
||||
public final val y: T?
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
interface Foo
|
||||
fun foo(): Foo? = null
|
||||
|
||||
fun <T> run(f: () -> T): T = f()
|
||||
|
||||
val foo: Foo = run {
|
||||
val x = foo()
|
||||
if (x == null) throw Exception()
|
||||
|
||||
@@ -4,7 +4,6 @@ public val foo: Foo
|
||||
public fun bar(): Foo
|
||||
public fun foo(): Foo?
|
||||
public fun </*0*/ T> repeat(/*0*/ arg: T): T
|
||||
public fun </*0*/ T> run(/*0*/ f: () -> T): T
|
||||
|
||||
public interface Foo {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// See also KT-7800
|
||||
|
||||
fun <T, R> T.let(f: (T) -> R): R = f(this)
|
||||
|
||||
fun foo(): Int {
|
||||
val x: Int = 1.let {
|
||||
val value: Int? = null
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
package
|
||||
|
||||
public fun foo(): kotlin.Int
|
||||
public fun </*0*/ T, /*1*/ R> T.let(/*0*/ f: (T) -> R): R
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
fun run(f: () -> Unit) = 0
|
||||
|
||||
fun foo(arg: Int?) {
|
||||
run {
|
||||
var x = arg
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Unit
|
||||
public fun run(/*0*/ f: () -> kotlin.Unit): kotlin.Int
|
||||
|
||||
-2
@@ -1,6 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
fun run(f: () -> Unit) = 0
|
||||
|
||||
fun foo(arg: Int?) {
|
||||
run {
|
||||
var x = arg
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Unit
|
||||
public fun run(/*0*/ f: () -> kotlin.Unit): kotlin.Int
|
||||
|
||||
-2
@@ -1,6 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
fun run(f: () -> Unit) = 0
|
||||
|
||||
class My {
|
||||
constructor(arg: Int?) {
|
||||
run {
|
||||
|
||||
-2
@@ -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
|
||||
|
||||
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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()
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
fun run(f: () -> Unit) = 0
|
||||
|
||||
fun foo(arg: Int?) {
|
||||
var x = arg
|
||||
if (x == null) return
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Unit
|
||||
public fun run(/*0*/ f: () -> kotlin.Unit): kotlin.Int
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
fun run(f: () -> Unit) = 0
|
||||
|
||||
fun foo(arg: Int?) {
|
||||
var x = arg
|
||||
if (x == null) return
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Unit
|
||||
public fun run(/*0*/ f: () -> kotlin.Unit): kotlin.Int
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// See KT-10056
|
||||
class Foo(val bar: String)
|
||||
|
||||
public inline fun <T, R> T.let(f: (T) -> R): R = f(this)
|
||||
|
||||
fun test(foo: Foo?) {
|
||||
foo?.bar.let {
|
||||
// Error, foo?.bar is nullable
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ foo: Foo?): kotlin.Unit
|
||||
public inline fun </*0*/ T, /*1*/ R> T.let(/*0*/ f: (T) -> R): R
|
||||
|
||||
public final class Foo {
|
||||
public constructor Foo(/*0*/ bar: kotlin.String)
|
||||
|
||||
-2
@@ -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, R> T.let(f: (T) -> R): R = f(this)
|
||||
|
||||
fun String?.call(f: (String?) -> String?) = f(this)
|
||||
|
||||
fun String.notNullLet(f: (String) -> Unit) = f(this)
|
||||
|
||||
-1
@@ -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 </*0*/ T, /*1*/ R> T.let(/*0*/ f: (T) -> R): R
|
||||
public fun kotlin.String.notNullLet(/*0*/ f: (kotlin.String) -> kotlin.Unit): kotlin.Unit
|
||||
|
||||
public final class Bar {
|
||||
|
||||
-2
@@ -1,7 +1,5 @@
|
||||
class Foo(val bar: String?)
|
||||
|
||||
public inline fun <T, R> T.let(f: (T) -> R): R = f(this)
|
||||
|
||||
fun test(foo: Foo?) {
|
||||
foo!!.bar.let {
|
||||
// Correct
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ foo: Foo?): kotlin.Unit
|
||||
public inline fun </*0*/ T, /*1*/ R> T.let(/*0*/ f: (T) -> R): R
|
||||
|
||||
public final class Foo {
|
||||
public constructor Foo(/*0*/ bar: kotlin.String?)
|
||||
|
||||
-2
@@ -12,8 +12,6 @@ public class Foo {
|
||||
}
|
||||
|
||||
// FILE: Test.kt
|
||||
public inline fun <T, R> T.let(f: (T) -> R): R = f(this)
|
||||
|
||||
fun test() {
|
||||
val foo = Foo.create(null)
|
||||
foo?.bar.let {
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
public inline fun </*0*/ T, /*1*/ R> T.let(/*0*/ f: (T) -> R): R
|
||||
|
||||
public open class Foo {
|
||||
private constructor Foo(/*0*/ bar: kotlin.String!)
|
||||
|
||||
Reference in New Issue
Block a user