[java] Properly resolve array types

- Honor dimensions of arrays
 - Resolve types for allocations as well as declarations of arrays
This commit is contained in:
Juan Martín Sotuyo Dodero
2017-10-26 22:30:14 -03:00
parent 2d15c6dba6
commit 05927af574
8 changed files with 85 additions and 36 deletions

View File

@ -2024,9 +2024,9 @@ void ArrayDimsAndInits() :
{
LOOKAHEAD(2)
( LOOKAHEAD(2) (Annotation() {checkForBadTypeAnnotations();})* "[" Expression() "]" )+ ( LOOKAHEAD(2) "[" "]" )*
( LOOKAHEAD(2) (Annotation() {checkForBadTypeAnnotations();})* "[" Expression() "]" {jjtThis.bumpArrayDepth();})+ ( LOOKAHEAD(2) "[" "]" {jjtThis.bumpArrayDepth();} )*
|
( "[" "]" )+ ArrayInitializer()
( "[" "]" {jjtThis.bumpArrayDepth();})+ ArrayInitializer()
}