Generate static backing fields for properties in object

#KT-4973 Fixed

Original commit: 5412a67d29
This commit is contained in:
Michael Bogdanov
2014-09-24 18:35:51 +04:00
parent 23d44bb45e
commit e41e37932a
9 changed files with 31 additions and 26 deletions
@@ -201,9 +201,9 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
doTest(fileName);
}
@TestMetadata("objectValChanged")
public void testObjectValChanged() throws Exception {
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/objectValChanged/");
@TestMetadata("objectConstantChanged")
public void testObjectConstantChanged() throws Exception {
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/objectConstantChanged/");
doTest(fileName);
}
@@ -0,0 +1,14 @@
Cleaning output files:
out/production/module/test/Object.class
End of files
Compiling files:
src/const.kt
End of files
Cleaning output files:
out/production/module/test/Object.class
out/production/module/test/Usage.class
End of files
Compiling files:
src/const.kt
src/usage.kt
End of files
@@ -0,0 +1,5 @@
package test
object Object {
val CONST = "old"
}
@@ -0,0 +1,5 @@
package test
object Object {
val CONST = "new"
}
@@ -0,0 +1,4 @@
package test
deprecated(Object.CONST + Object.CONST)
class Usage
@@ -1,6 +0,0 @@
Cleaning output files:
out/production/module/test/Object.class
End of files
Compiling files:
src/const.kt
End of files
@@ -1,6 +0,0 @@
package test
object Object {
// Value is changed, but we don't care, it is not compile-time constant, and therefore can't be inlined
val CONST = "old"
}
@@ -1,6 +0,0 @@
package test
object Object {
// Value is changed, but we don't care, it is not compile-time constant, and therefore can't be inlined
val CONST = "new"
}
@@ -1,5 +0,0 @@
package test
fun main(args: Array<String>) {
val x = Object.CONST + Object.CONST
}