Fixes #309: [java] Parse error on method reference

This commit is contained in:
Andreas Dangel
2017-03-27 21:06:09 +02:00
parent 88763bf58d
commit abe2e8561c
4 changed files with 23 additions and 1 deletions

View File

@ -1,4 +1,9 @@
/**
* Allow method references to specify generics also for
* constructor references ("new").
* Bug #309
* Andreas Dangel 03/2017
*====================================================================
* Provide a better fix for CastExpression, getting rid of most hacks.
* Bug #257
*
@ -1831,7 +1836,7 @@ Token t;
void MethodReference() :
{Token t; checkForBadMethodReferenceUsage();}
{
"::" ("new" {jjtThis.setImage("new");} | [TypeArguments()] t=<IDENTIFIER> {jjtThis.setImage(t.image);} )
"::" [TypeArguments()] ( "new" {jjtThis.setImage("new");} | t=<IDENTIFIER> {jjtThis.setImage(t.image);} )
}
void PrimaryPrefix() :