--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Tue Dec 11 08:05:38 2018 +0800
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Tue Dec 11 09:10:24 2018 +0100
@@ -1121,7 +1121,7 @@
public void visitVarDef(JCVariableDecl tree) {
// Local variables have not been entered yet, so we need to do it now:
- if (env.info.scope.owner.kind == MTH) {
+ if (env.info.scope.owner.kind == MTH || env.info.scope.owner.kind == VAR) {
if (tree.sym != null) {
// parameters have already been entered
env.info.scope.enter(tree.sym);