src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
changeset 55561 4c0a7916d3cd
parent 55306 ea43db53de91
child 57724 447d48371b41
equal deleted inserted replaced
55560:cb0131439e9d 55561:4c0a7916d3cd
   773         return result;
   773         return result;
   774     }
   774     }
   775 
   775 
   776     public JCExpression unannotatedType(boolean allowVar) {
   776     public JCExpression unannotatedType(boolean allowVar) {
   777         JCExpression result = term(TYPE);
   777         JCExpression result = term(TYPE);
   778         Name restrictedTypeName;
   778         Name restrictedTypeName = restrictedTypeName(result, !allowVar);
   779 
   779 
   780         if (!allowVar && (restrictedTypeName = restrictedTypeName(result, true)) != null) {
   780         if (restrictedTypeName != null && (!allowVar || restrictedTypeName != names.var)) {
   781             syntaxError(result.pos, Errors.RestrictedTypeNotAllowedHere(restrictedTypeName));
   781             syntaxError(result.pos, Errors.RestrictedTypeNotAllowedHere(restrictedTypeName));
   782         }
   782         }
   783 
   783 
   784         return result;
   784         return result;
   785     }
   785     }