Fix error type for implicit invoke with function literal argument
#KT-11401 Fixed
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
class TestClass {
|
||||
companion object {
|
||||
inline operator fun <T> invoke(task: () -> T) = task()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val test1 = TestClass { "K" }
|
||||
if (test1 != "K") return "fail1, 'test1' == $test1"
|
||||
|
||||
val ok = "OK"
|
||||
|
||||
val x = TestClass { return ok }
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
class TestClass {
|
||||
inline operator fun <T> invoke(task: () -> T) = task()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val test = TestClass()
|
||||
val ok = "OK"
|
||||
|
||||
val x = test { return ok }
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
@kotlin.Metadata
|
||||
public final class ImplicitInvokeInCompanionObjectWithFunctionalArgumentKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TestClass {
|
||||
public final static field Companion: TestClass.Companion
|
||||
inner class TestClass/Companion
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final static class TestClass/Companion {
|
||||
inner class TestClass/Companion
|
||||
private method <init>(): void
|
||||
public final method invoke(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
@kotlin.Metadata
|
||||
public final class ImplicitInvokeWithFunctionLiteralArgumentKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TestClass {
|
||||
public method <init>(): void
|
||||
public final method invoke(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
@kotlin.Metadata
|
||||
public final class ImplicitInvokeInCompanionObjectWithFunctionalArgumentKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TestClass {
|
||||
public final static field Companion: TestClass.Companion
|
||||
inner class TestClass/Companion
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final static class TestClass/Companion {
|
||||
inner class TestClass/Companion
|
||||
private method <init>(): void
|
||||
public final method invoke(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
@kotlin.Metadata
|
||||
public final class ImplicitInvokeWithFunctionLiteralArgumentKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TestClass {
|
||||
public method <init>(): void
|
||||
public final method invoke(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object
|
||||
}
|
||||
Reference in New Issue
Block a user