KT-2279 Setter generated for abstract var is not abstract

#KT-2279 fixed
This commit is contained in:
Evgeny Gerashchenko
2012-06-20 19:15:41 +04:00
parent ee5aab228b
commit 95249099eb
3 changed files with 6 additions and 5 deletions
@@ -251,6 +251,7 @@ public class PropertyCodegen {
int modifiers = JetTypeMapper.getAccessModifiers(propertyDescriptor, 0);
PropertySetterDescriptor setter = propertyDescriptor.getSetter();
int flags = setter == null ? modifiers : JetTypeMapper.getAccessModifiers(setter, modifiers);
flags |= (propertyDescriptor.getModality() == Modality.ABSTRACT ? Opcodes.ACC_ABSTRACT : 0);
generateDefaultSetter(propertyDescriptor, flags, p);
}
@@ -1,5 +1,5 @@
abstract class ClassValAbstract {
abstract val a: Int
abstract var a: Int
class object {
val methods = (this as java.lang.Object).getClass()?.getClassLoader()?.loadClass("ClassValAbstract")?.getMethods()
@@ -8,11 +8,11 @@ abstract class ClassValAbstract {
fun box() : String {
for(m in ClassValAbstract.methods) {
if(m.sure().getName() == "getA") {
if (m.sure().getName() == "getA") {
if(m.sure().getModifiers() != 1025)
return "get failed"
}
if(m.sure().getName() == "setA") {
if (m.sure().getName() == "setA") {
if(m.sure().getModifiers() != 1025)
return "set failed"
}
@@ -227,9 +227,9 @@ public class PropertyGenTest extends CodegenTestCase {
blackBoxFile("regressions/kt1398.kt");
}
public void testKt1482() throws Exception {
public void testKt1482_2279() throws Exception {
createEnvironmentWithFullJdk();
blackBoxFile("regressions/kt1482.kt");
blackBoxFile("regressions/kt1482_2279.kt");
}
public void testKt1714() throws Exception {