1 /*
   2  * @test /nodynamiccopyright/
   3  * @bug 8206986
   4  * @summary Verify switch over boolean/long/float/double is not allowed.
   5  * @compile/fail/ref=SwitchNoExtraTypes.out -XDrawDiagnostics SwitchNoExtraTypes.java
   6  */
   7 
   8 public class SwitchNoExtraTypes {
   9 
  10     private void switchBoolean(boolean b) {
  11         switch (b) {
  12             case true: return ;
  13         }
  14     }
  15 
  16     private void switchLong(long l) {
  17         switch (l) {
  18             case 0: return ;
  19         }
  20     }
  21 
  22     private void switchFloat(float f) {
  23         switch (f) {
  24             case 0: return ;
  25         }
  26     }
  27 
  28     private void switchDouble(double d) {
  29         switch (d) {
  30             case 0: return ;
  31         }
  32     }
  33 
  34 }