8185983: Javac should reject TypeArguments on field access expression
Reviewed-by: mcimadamore
This commit is contained in:
parent
589129ece4
commit
18f70cfdd2
@ -1319,6 +1319,9 @@ public class JavacParser implements Parser {
|
|||||||
break loop;
|
break loop;
|
||||||
case DOT:
|
case DOT:
|
||||||
nextToken();
|
nextToken();
|
||||||
|
if (token.kind == TokenKind.IDENTIFIER && typeArgs != null) {
|
||||||
|
return illegal();
|
||||||
|
}
|
||||||
int oldmode = mode;
|
int oldmode = mode;
|
||||||
mode &= ~NOPARAMS;
|
mode &= ~NOPARAMS;
|
||||||
typeArgs = typeArgumentsOpt(EXPR);
|
typeArgs = typeArgumentsOpt(EXPR);
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* @test /nodynamiccopyright/
|
||||||
|
* @bug 8185983
|
||||||
|
* @summary Javac should reject TypeArguments on field access expression
|
||||||
|
* @compile/fail/ref=RejectTypeArgsOnSelectTest.out -XDrawDiagnostics RejectTypeArgsOnSelectTest.java
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
class RejectTypeArgsOnSelectTest {
|
||||||
|
Iterator<RejectTypeArgsOnSelectTest> nullIter = Collections.<RejectTypeArgsOnSelectTest>EMPTY_LIST.iterator();
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
RejectTypeArgsOnSelectTest.java:11:104: compiler.err.illegal.start.of.expr
|
||||||
|
1 error
|
Loading…
x
Reference in New Issue
Block a user