Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
IPDSnelting
mjtest-tests
Commits
49e75ef2
Commit
49e75ef2
authored
Nov 04, 2021
by
uxrog
Browse files
Merge branch 'syntax/multi-dimensional-array' into 'master'
Add test for multi dimensional arrays See merge request
!21
parents
7f44cdbc
7368d945
Pipeline
#174626
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
syntax/MultiDimensionalArrays.mj
0 → 100644
View file @
49e75ef2
class Foo {
public static void main(String[] args) {
/* An array with a size in the first brackets is valid */
int[][][][] array = new int[20][][][];
/* The expression is not checked for validity */
int[][][][] array = new int[a || b || c && d > true < null][][][];
/* This should parse as an array access and be valid */
int array = new int[20][4];
int array = (new int[20])[4];
/* Array dimension is not checked */
int array = new int[20][4][true][null];
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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