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
Original commit: ff676c050f
This commit is contained in:
+6
@@ -1466,6 +1466,12 @@ public class ExperimentalIncrementalJpsTestGenerated extends AbstractExperimenta
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassNotGeneratedWhenRebuilding")
|
||||
public void testInnerClassNotGeneratedWhenRebuilding() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/classHierarchyAffected/innerClassNotGeneratedWhenRebuilding/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jvmNameChanged")
|
||||
public void testJvmNameChanged() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/classHierarchyAffected/jvmNameChanged/");
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
abstract class Introspector<M : Model>(protected val model: Model) {
|
||||
protected abstract inner class Retriever(protected val transaction: Any) {
|
||||
protected var model: Model = this@Introspector.model
|
||||
}
|
||||
|
||||
protected abstract inner class SchemaRetriever(transaction: Any): Retriever(transaction) {
|
||||
protected inline fun inSchema(crossinline modifier: (Any) -> Unit) =
|
||||
model.modify { schema -> modifier.invoke(schema) }
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class IntrospectorImpl(model: ModuleImpl) : Introspector<ModuleImpl>(model) {
|
||||
private inner class SchemaRetriever(transaction: Any) : Introspector<ModuleImpl>.SchemaRetriever(transaction) {
|
||||
internal fun retrieve() {
|
||||
inSchema { schema -> println(schema) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ModuleImpl : Model {
|
||||
override fun modify(modifier: ModelModifier) {}
|
||||
}
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
public interface Model {
|
||||
void modify(ModelModifier modifier);
|
||||
}
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
public interface ModelModifier {
|
||||
void perform(Object element);
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Compiling files:
|
||||
src/IntrospectorImpl.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
Reference in New Issue
Block a user