Properly generate inner classes when compiling source for inline

KT-19175: Compiler generates different bytecode when classes are compiled separately or together

 #KT-19175 Fixed
This commit is contained in:
Mikhael Bogdanov
2017-07-26 13:32:46 +02:00
parent 7da6ff78c1
commit ff676c050f
24 changed files with 312 additions and 32 deletions
+14
View File
@@ -0,0 +1,14 @@
class Introspector {
inner class SchemaRetriever(val transaction: String) {
inline fun inSchema(crossinline modifier: (String) -> Unit) =
{ modifier(transaction) }()
internal fun retrieve() {
inSchema { schema -> "OK" }
}
}
}
// TESTED_OBJECT_KIND: innerClass
// TESTED_OBJECTS: Introspector$SchemaRetriever$inSchema$1, SchemaRetriever
// FLAGS: ACC_FINAL, ACC_PUBLIC
+20
View File
@@ -0,0 +1,20 @@
interface Introspector {
class SchemaRetriever(val transaction: String) {
inline fun inSchema(crossinline modifier: (String) -> Unit) =
{ modifier(transaction) }()
internal fun retrieve() {
inSchema { schema -> "OK" }
}
}
}
// TESTED_OBJECT_KIND: innerClass
// TESTED_OBJECTS: Introspector$SchemaRetriever$inSchema$1, SchemaRetriever
// FLAGS: ACC_FINAL, ACC_PUBLIC, ACC_STATIC
// TESTED_OBJECT_KIND: innerClass
// TESTED_OBJECTS: Introspector$SchemaRetriever$inSchema$1, DefaultImpls
// ABSENT: true
+20
View File
@@ -0,0 +1,20 @@
interface Introspector {
fun test() {
class SchemaRetriever(val transaction: String) {
inline fun inSchema(crossinline modifier: (String) -> Unit) =
{ modifier(transaction) }()
internal fun retrieve() {
inSchema { schema -> "OK" }
}
}
}
}
// TESTED_OBJECT_KIND: innerClass
// TESTED_OBJECTS: Introspector$test$SchemaRetriever, SchemaRetriever
// FLAGS: ACC_FINAL, ACC_PUBLIC, ACC_STATIC
// TESTED_OBJECT_KIND: innerClass
// TESTED_OBJECTS: Introspector$test$SchemaRetriever, DefaultImpls
// FLAGS: ACC_FINAL, ACC_PUBLIC, ACC_STATIC