Commit 4b78c8d3 authored by uwdkl's avatar uwdkl

More tests

parent 318228bb
class ExprStmt {
public int foo() {}
public static void main(String[] args) {
foo() + foo();
}
}
class ArrayOutOfBounds {
public static void main(String[] args) {
int[] x = new int[5];
/* This is a runtime error, the compiler shouldn't care */
int y = x[10];
}
}
class Foo {
Foo Foo;
Foo Foo(Foo Foo) {
Foo.Foo = new Foo();
return Foo;
}
public static void main(String[] args) {
Foo = Foo(new Foo());
}
}
class NewArrayAccess {
public static void main(String[] args) {
/*
* In Java, this is invalid, since this creates a new 2D array (which is not the type of x)
* In MiniJava, this is valid, because this creates a new array of size 5 and access the first element
*/
int x = new int[5][1];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment