split SuperGenTest.enclosed
This commit is contained in:
+1
-12
@@ -8,26 +8,17 @@ trait K : BK {
|
|||||||
|
|
||||||
open class M() {
|
open class M() {
|
||||||
open fun x() : Int = 10
|
open fun x() : Int = 10
|
||||||
|
|
||||||
open var y = 500
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open class N() : M(), K {
|
open class N() : M(), K {
|
||||||
|
|
||||||
override fun x() : Int = 20
|
override fun x() : Int = 20
|
||||||
|
|
||||||
override var y = 200
|
|
||||||
|
|
||||||
open class C() : K {
|
open class C() : K {
|
||||||
fun test1() = x()
|
fun test1() = x()
|
||||||
fun test2() = super<M>@N.x()
|
fun test2() = super<M>@N.x()
|
||||||
fun test3() = super<K>@N.x()
|
fun test3() = super<K>@N.x()
|
||||||
fun test4() = super<K>.x()
|
fun test4() = super<K>.x()
|
||||||
fun test5() = y
|
|
||||||
fun test6() : Int {
|
|
||||||
super<M>@N.y += 200
|
|
||||||
return super<M>@N.y
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,7 +27,5 @@ fun box(): String {
|
|||||||
if (N().C().test2() != 10) return "test2 fail";
|
if (N().C().test2() != 10) return "test2 fail";
|
||||||
if (N().C().test3() != 100) return "test3 fail";
|
if (N().C().test3() != 100) return "test3 fail";
|
||||||
if (N().C().test4() != 100) return "test4 fail";
|
if (N().C().test4() != 100) return "test4 fail";
|
||||||
if (N().C().test5() != 200) return "test5 fail";
|
|
||||||
if (N().C().test6() != 700) return "test6 fail";
|
|
||||||
return "OK";
|
return "OK";
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
open class M() {
|
||||||
|
open var y = 500
|
||||||
|
}
|
||||||
|
|
||||||
|
open class N() : M() {
|
||||||
|
|
||||||
|
override var y = 200
|
||||||
|
|
||||||
|
open class C() {
|
||||||
|
fun test5() = y
|
||||||
|
fun test6() : Int {
|
||||||
|
super<M>@N.y += 200
|
||||||
|
return super<M>@N.y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
if (N().C().test5() != 200) return "test5 fail";
|
||||||
|
if (N().C().test6() != 700) return "test6 fail";
|
||||||
|
return "OK";
|
||||||
|
}
|
||||||
@@ -21,8 +21,14 @@ public class SuperGenTest extends CodegenTestCase {
|
|||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEnclosedMethod () {
|
public void testEnclosedFun () {
|
||||||
blackBoxFile("/super/enclosed.jet");
|
blackBoxFile("/super/enclosedFun.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testEnclosedVar () {
|
||||||
|
blackBoxFile("/super/enclosedVar.jet");
|
||||||
|
// System.out.println(generateToText());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user