added another test case to check vars work in object declarations
This commit is contained in:
@@ -39,6 +39,9 @@ public final class ObjectTest extends SingleFileTranslationTest {
|
|||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testObjectDeclarationWithVars() throws Exception {
|
||||||
|
fooBoxTest();
|
||||||
|
}
|
||||||
|
|
||||||
public void testObjectInMethod() throws Exception {
|
public void testObjectInMethod() throws Exception {
|
||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
object State {
|
||||||
|
val c = 2
|
||||||
|
val b = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() : Boolean {
|
||||||
|
if (State.c != 2) return false
|
||||||
|
if (State.b != 1) return false
|
||||||
|
return true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user