@@ -287,26 +287,28 @@ private void handleSwitch(JCTree tree,
287287 //int $idx = 0;
288288 //$RESTART: switch (invokeDynamic typeSwitch($constant, typeof($pattern1), typeof($pattern2), typeof($pattern3))($obj, $idx)) {
289289 // case 0:
290- // if (!(<desugared $pattern1)) { $idx = 1; continue $RESTART; }
290+ // if (!(<desugared $pattern1> )) { $idx = 1; continue $RESTART; }
291291 // $stats$
292292 // case 1:
293- // if (!(<desugared $pattern1)) { $idx = 2; continue $RESTART; }
293+ // if (!(<desugared $pattern1> )) { $idx = 2; continue $RESTART; }
294294 // $stats$
295295 // case 2, -1:
296- // if (!(<desugared $pattern1)) { $idx = 3; continue $RESTART; }
296+ // if (!(<desugared $pattern1> )) { $idx = 3; continue $RESTART; }
297297 // $stats$
298298 // case 3:
299- // if (!(<desugared $pattern1)) { $idx = 4; continue $RESTART; }
299+ // if (!(<desugared $pattern1> )) { $idx = 4; continue $RESTART; }
300300 // $stats$
301301 //}
302302 //notes:
303303 //-pattern desugaring performs assignment to the binding variables
304304 //-the selector is evaluated only once and stored in a temporary variable
305305 //-typeSwitch bootstrap method can restart matching at specified index. The bootstrap will
306306 // categorize the input, and return the case index whose type or constant matches the input.
307- // The bootstrap does not evaluate guards, which are injected at the begining of the case's
307+ // The bootstrap does not evaluate guards, which are injected at the beginning of the case's
308308 // statement list, and if the guard fails, the switch is "continued" and matching is
309309 // restarted from the next index.
310+ //-case null is always desugared to case -1, as the typeSwitch bootstrap method will
311+ // return -1 when the input is null
310312 //
311313 //a special case for switches over enums with pattern case
312314 //only a single (type) pattern case is valid, which is equivalent
0 commit comments