OpenJDK / valhalla / valhalla
changeset 52029:142e4a2255f4 lworld
[lworld] Fix test failure; Also cleanup and comment recent change.
author | sadayapalam |
---|---|
date | Wed, 19 Sep 2018 14:06:06 +0530 |
parents | 6601da9e0237 |
children | ccc5a29b1200 |
files | src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java Wed Sep 19 12:07:21 2018 +0530 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java Wed Sep 19 14:06:06 2018 +0530 @@ -1348,9 +1348,10 @@ } break loop; case LT: - if ((mode & TYPE) == 0 && isUnboundMemberRef()) { - //this is an unbound method reference whose qualifier - //is a generic type i.e. A<S>::m + if ((mode & TYPE) == 0 && isParameterizedTypePrefix()) { + //this is either an unbound method reference whose qualifier + //is a generic type i.e. A<S>::m or a default value creation of + //the form ValueType<S>.default int pos1 = token.pos; accept(LT); ListBuffer<JCExpression> args = new ListBuffer<>(); @@ -1364,9 +1365,9 @@ while (token.kind == DOT) { nextToken(); if (token.kind == DEFAULT) { + t = toP(F.at(token.pos).Select(t, names._default)); + nextToken(); selectExprMode(); - t = F.at(pos).Select(t, names._default); - nextToken(); return term3Rest(t, typeArgs); } selectTypeMode(); @@ -1579,11 +1580,12 @@ /** * If we see an identifier followed by a '<' it could be an unbound - * method reference or a binary expression. To disambiguate, look for a + * method reference or a default value creation that uses a parameterized type + * or a binary expression. To disambiguate, look for a * matching '>' and see if the subsequent terminal is either '.' or '::'. */ @SuppressWarnings("fallthrough") - boolean isUnboundMemberRef() { + boolean isParameterizedTypePrefix() { int pos = 0, depth = 0; outer: for (Token t = S.token(pos) ; ; t = S.token(++pos)) { switch (t.kind) {