src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
changeset 51563 de411d537aae
parent 50898 12133a6e2613
child 51721 96b76dca2be8
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Tue Aug 28 09:01:54 2018 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Wed Aug 29 09:36:17 2018 +0200
@@ -1154,6 +1154,18 @@
     }
 
     /**
+     * A tree scanner suitable for visiting the target-type dependent nodes nested
+     * within a switch expression body.
+     */
+    static class SwitchExpressionScanner extends FilterScanner {
+
+        SwitchExpressionScanner() {
+            super(EnumSet.of(BLOCK, CASE, CATCH, DOLOOP, FOREACHLOOP,
+                    FORLOOP, IF, BREAK, SYNCHRONIZED, SWITCH, TRY, WHILELOOP));
+        }
+    }
+
+    /**
      * This visitor is used to check that structural expressions conform
      * to their target - this step is required as inference could end up
      * inferring types that make some of the nested expressions incompatible