Add disabled test. Depends on KT-1198

This commit is contained in:
unknown
2012-03-09 19:20:19 +04:00
parent beff2f9b1e
commit 26a5ff3a2f
3 changed files with 49 additions and 2 deletions
@@ -61,11 +61,17 @@ public final class MiscTest extends AbstractExpressionTest {
}
public void testKt740() throws Exception {
public void testKt740_1() throws Exception {
checkFooBoxIsTrue("KT-740.kt");
}
public void testKt740_2() throws Exception {
checkFooBoxIsOk("KT-740-2.kt");
}
//TODO: depends on KT-1198
//TODO: look into BindingContext.VARIABLE_REASSIGNMENT
// public void testKt740_3() throws Exception {
// checkFooBoxIsOk("KT-740-3.kt");
// }
}
@@ -76,7 +76,7 @@ public final class KotlinPropertyAccessTranslator extends PropertyAccessTranslat
@NotNull
public JsExpression translateAsSet(@Nullable JsExpression receiver, @NotNull JsExpression toSetTo) {
PropertySetterDescriptor setter = propertyDescriptor.getSetter();
assert setter != null : "Getter for kotlin properties should bot be null.";
assert setter != null : "Setter for kotlin properties should bot be null.";
return callBuilderForAccessor(receiver)
.args(toSetTo)
.descriptor(setter)
@@ -0,0 +1,41 @@
package foo
var c0 = 0
var c1 = 0
var c2 = 0
class A() {
var p = 0
fun divAssign(a : Int) {
c1++;
}
fun times(a : Int) {
c2++;
}
}
val a : A = A()
get() {
c0++
return $a
}
fun box() : String {
a /= 3
if (c0 != 1) {
return "1"
}
if (c1 != 1) {
return "2"
}
a *= 3
if (c0 != 1) {
return "3"
}
if (c2 != 1) {
return "4"
}
return "OK"
}