Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
uydwl
mjtest-tests
Commits
4b78c8d3
Unverified
Commit
4b78c8d3
authored
Nov 15, 2018
by
uwdkl
Browse files
More tests
parent
318228bb
Changes
4
Hide whitespace changes
Inline
Side-by-side
expression_statement.invalid.java
0 → 100644
View file @
4b78c8d3
class
ExprStmt
{
public
int
foo
()
{}
public
static
void
main
(
String
[]
args
)
{
foo
()
+
foo
();
}
}
semantic/array_out_of_bounds.java
0 → 100644
View file @
4b78c8d3
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
];
}
}
semantic/namespaces.java
0 → 100644
View file @
4b78c8d3
class
Foo
{
Foo
Foo
;
Foo
Foo
(
Foo
Foo
)
{
Foo
.
Foo
=
new
Foo
();
return
Foo
;
}
public
static
void
main
(
String
[]
args
)
{
Foo
=
Foo
(
new
Foo
());
}
}
semantic/new_array_access.mj
0 → 100644
View file @
4b78c8d3
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];
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment