Generate public constructor for anonymous objects if it inside inline fun

#KT-9331 Fixed
This commit is contained in:
Michael Bogdanov
2015-10-21 13:52:58 +03:00
parent 3d56012184
commit f4d3ecf8e6
9 changed files with 83 additions and 1 deletions
@@ -0,0 +1,5 @@
import test.*
fun box(): String {
return A().doSomething().run()
}
@@ -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"
}
}
}
@@ -0,0 +1,5 @@
import test.*
fun box(): String {
return A().doSomething()
}
@@ -0,0 +1,9 @@
package test
internal class A {
inline fun doSomething(): String {
return {
"OK"
}()
}
}
@@ -0,0 +1,5 @@
import test.*
fun box(): String {
return A().doSomething("OK")
}
@@ -0,0 +1,9 @@
package test
internal class A {
inline fun doSomething(s: String): String {
return {
s
}()
}
}