I hear voices ... and they tell me to like multi dimensional arrays

private static void testMultiDimArrayWithAnnotations() {
		// ever used a 2D-Array in java??
		Object x = new Object @NonNull[2] @Nullable[1] @NonNull[3];
	}
This commit is contained in:
snap252
2017-05-30 15:15:44 +02:00
parent 3e75ddc188
commit a4754e9fc9
2 changed files with 8 additions and 2 deletions

View File

@ -1921,7 +1921,7 @@ void AllocationExpression():
(LOOKAHEAD(2)
PrimitiveType() ArrayDimsAndInits()
|
ClassOrInterfaceType() ((Annotation() {checkForBadTypeAnnotations();})*) [ TypeArguments() ]
ClassOrInterfaceType() [ TypeArguments() ]
(
ArrayDimsAndInits()
|
@ -1937,8 +1937,9 @@ void AllocationExpression():
void ArrayDimsAndInits() :
{}
{
LOOKAHEAD(2)
( LOOKAHEAD(2) "[" Expression() "]" )+ ( LOOKAHEAD(2) "[" "]" )*
( LOOKAHEAD(2) ((Annotation() {checkForBadTypeAnnotations();})*) "[" Expression() "]" )+ ( LOOKAHEAD(2) "[" "]" )*
|
( "[" "]" )+ ArrayInitializer()
}

View File

@ -184,6 +184,11 @@ public class ParserCornerCases18 {
public Object createNonNullArray() {
return new Object @NonNull[0];
}
private static void testMultiDimArrayWithAnnotations() {
// ever used a 2D-Array in java??
Object x = new Object @NonNull[2] @Nullable[1] @NonNull[3];
}
/**