Remove KForeignMemberProperty and KClassOrigin, use KMemberPropertyImpl instead

This commit is contained in:
Alexander Udalov
2015-02-20 19:22:30 +03:00
parent ff0044f66a
commit fdfd808d80
8 changed files with 69 additions and 128 deletions
@@ -9,8 +9,8 @@ fun box(): String {
val s = J::s
// Check that correct reflection objects are created
assert(i.javaClass.getSimpleName() == "KForeignMemberProperty", "Fail i class")
assert(s.javaClass.getSimpleName() == "KMutableForeignMemberProperty", "Fail s class")
assert(i.javaClass.getSimpleName() == "KMemberPropertyImpl", "Fail i class")
assert(s.javaClass.getSimpleName() == "KMutableMemberPropertyImpl", "Fail s class")
// Check that no Method objects are created for such properties
assert(i.javaGetter == null, "Fail i getter")
@@ -0,0 +1,11 @@
package test;
public class equalsHashCodeToString {
public final boolean b;
public char c;
public equalsHashCodeToString() {
this.b = false;
this.c = '0';
}
}
@@ -0,0 +1,17 @@
package test
import kotlin.test.*
import test.equalsHashCodeToString as J
fun box(): String {
assertEquals("val test.equalsHashCodeToString.b", (J::b).toString())
assertEquals("var test.equalsHashCodeToString.c", (J::c).toString())
assertTrue(J::b == J::b)
assertFalse(J::c == J::b)
assertTrue(J::b.hashCode() == J::b.hashCode())
assertFalse(J::b.hashCode() == J::c.hashCode())
return "OK"
}
@@ -332,6 +332,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod
@TestDataPath("$PROJECT_ROOT")
@InnerTestClasses({
Reflection.Mapping.class,
Reflection.Properties.class,
})
@RunWith(JUnit3RunnerWithInners.class)
public static class Reflection extends AbstractBlackBoxCodegenTest {
@@ -359,6 +360,21 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod
doTestAgainstJava(fileName);
}
}
@TestMetadata("compiler/testData/codegen/boxAgainstJava/reflection/properties")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Properties extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInProperties() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/reflection/properties"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("equalsHashCodeToString.kt")
public void testEqualsHashCodeToString() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxAgainstJava/reflection/properties/equalsHashCodeToString.kt");
doTestAgainstJava(fileName);
}
}
}
@TestMetadata("compiler/testData/codegen/boxAgainstJava/sam")