Generate public constructor for anonymous objects if it inside inline fun
#KT-9331 Fixed
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().doSomething().run()
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
interface Run {
|
||||
fun run(): String
|
||||
}
|
||||
|
||||
internal class A {
|
||||
inline fun doSomething(): Run {
|
||||
return object : Run {
|
||||
override fun run(): String = "OK"
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().doSomething()
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
internal class A {
|
||||
inline fun doSomething(): String {
|
||||
return {
|
||||
"OK"
|
||||
}()
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().doSomething("OK")
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
internal class A {
|
||||
inline fun doSomething(s: String): String {
|
||||
return {
|
||||
s
|
||||
}()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user